teleren/devto huggingface dataset:
C# Xunit Unit testing Withwith Dependency Injection
Tags: dotnet, unittest, xunit
Published: 2024-02-20 07:40:02

in A dote net core 6 API project, i use Xunit for unit testing, i'm trying to test a method inside a service ICrpForcastsService that i implement in a partial class CrpForcastsService

```
public class ForcastTester: IClassFixture<InjectionFixture>
{
    private readonly InjectionFixture injection;
    private readonly Psz.Core.Identity.Models.UserModel _user;
    private readonly ICrpForcastsService _crpForcastsService;
    public ForcastTester(InjectionFixture injection, ICrpForcastsService crpForcastsService)
    {
        this.injection = injection;
        var helpers = new TestingHelpers();
        _user = helpers.GetDefaultTestUser();
        _crpForcastsService = crpForcastsService;
    }
    [Fact]
    public void TestGetForecasts()
    {
        #region Arrange
        var expected = typeof(Psz.Core.Common.Models.ResponseModel<IEnumerable<Psz.Core.CRP.Models.Forcasts.ForcastHeaderModel>>);
        #endregion
        #region Act
        var result = _crpForcastsService.GetForcasts(_user);
        #endregion
        #region Assert
        Assert.NotNull(result);
        Assert.NotNull(result.Body);
        Assert.True(result.Success);
        Assert.IsType(expected, result);
        Assert.True(result.Body.Count() > 0);
        #endregion
    }
}
```
and i made a fixture class to initiate the startup with a test server like so:
```
public class InjectionFixture
{
    public readonly TestServer server;
    private readonly HttpClient client;

    public InjectionFixture()
    {
        server = new TestServer(new WebHostBuilder().UseStartup<Startup>());
        client = server.CreateClient();
    }
    public IServiceProvider ServiceProvider => server.Host.Services;

    public void Dispose()
    {
        Dispose(true);
    }
    protected virtual void Dispose(bool disposing)
    {
        if(disposing)
        {
            server.Dispose();
            client.Dispose();
        }
    }
}
```

and the Startup class where i set the webHsotBuilder and add the service that i'm testting:

```
public class Startup
{
    public Startup()
    {
        var builder = new ConfigurationBuilder()
            .SetBasePath(Directory.GetCurrentDirectory())
            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
            .AddEnvironmentVariables();
        Configuration = builder.Build();
    }
    public IConfigurationRoot Configuration { get; }
    public virtual void ConfigureServices(IServiceCollection services)
    {
        services.AddScoped<ICrpForcastsService, CrpForcastsService>();
        services.AddControllers();
    }
    public virtual void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
    }
}
```

when i rn the test i get this Error:

```
(No service for type 'Microsoft.AspNetCore.Builder.IApplicationBuilder' has been registered.) (The following constructor parameters did not have matching fixture data: ICrpForcastsService crpForcastsService)
```
what i'm i missing ??
Why You Can’t Limit Design Preference Changes from Clients | English for Freelance Designers
Tags: hocify, freelance, designers, businessenglish
Published: 2024-02-20 07:33:07

Do you, as a freelance developer like Max, dislike clients who frequently change design preferences without clear communication, leading to inconsistency in the UI/UX design process, when designing websites, mobile apps, etc.? Explore a real-life situation with us. Let's foster Business English Communication Skills as we find solutions together!

Min: Welcome to Hocify, where we foster business English communication skills through real-life situations. After the lesson, if you missed something, please check out the description to access the transcript for more details on our website ‘hocify dot com’, along with related tools and resources. Now, let’s dive into today’s challenge!

Max: Hey Min, can we chat about something that’s been on my mind regarding our project?

Min: Sure, Max. What’s up?

Max: Well, I’ve noticed that our design preferences seem to change quite a bit during the project. I’m curious about why that might be happening.

Min: Yeah, you’re right. I’ve been feeling that too. But I’m not exactly sure why it keeps happening.

Max: Let’s try to figure it out together. Why do you think we’re having trouble sticking to a consistent design?

Min: Hmm, maybe it’s because we haven’t really talked about what we want the app to look like in detail.

Max: That could be it. But why do you think we haven’t had those detailed discussions?

Min: I guess we’ve been focusing more on getting things done quickly rather than really planning out the design from the start.

Max: I see. So, why do you think it’s important for us to have a clear plan for the design?

Min: Well, if we don’t have a clear plan, it’s easy for us to change our minds a lot, which can make the design inconsistent and confusing for users.

Max: That makes sense. And why do you think inconsistency in the design could be a problem?

Min: Because if the design keeps changing, it might make the app look unprofessional and make it harder for users to figure out how to use it.

Max: Right. And why do you think it’s important for us to address this issue now?

Min: Because if we don’t, it could end up causing more problems later on, and we might have to spend even more time fixing things.

Max: Thanks for sharing your thoughts, Min. It seems like our main challenge is that we haven’t spent enough time planning and discussing our design goals upfront, which has led to inconsistency in our design decisions.

Min: Yeah, I think you’re onto something, Max. So, what do you think we should do about it?

Max: Let’s work together to establish a clear plan for the design and make sure we’re on the same page moving forward. That way, we can avoid unnecessary changes and keep the design consistent throughout the project.

Min: Sounds like a plan, Max. Thanks for bringing this up, and let’s make sure we tackle this challenge head-on.

**Steps to Limit Design Preference Changes from Clients: https://hocify.com/x/5gnb**

#hocify #freelance #designers #businessenglish #communicationskills #programmers #coders #freelancers
Implementing a Loading Page State in ReactJS: Enhancing User Experience with Loading Indicators
Tags: webdev, react, javascript, nextjs
Published: 2024-02-20 07:32:37

In ReactJS, you can create a loading page state to indicate to users that the application is in the process of loading data or performing an operation. Here's a basic example of how you can implement a loading page state in React:

```jsx
import React, { useState, useEffect } from 'react';

function App() {
  const [loading, setLoading] = useState(true); // State to track loading status

  useEffect(() => {
    // Simulate data loading delay with setTimeout
    const loadData = () => {
      setTimeout(() => {
        setLoading(false); // Set loading state to false after delay
      }, 2000); // Simulated loading time: 2000 milliseconds (2 seconds)
    };

    loadData(); // Call loadData function when component mounts
  }, []); // Empty dependency array to run effect only once on mount

  return (
    <div>
      {loading ? (
        <div>Loading...</div> // Render loading message when loading state is true
      ) : (
        <div>Loaded successfully!</div> // Render content when loading state is false
      )}
    </div>
  );
}

export default App;
```

In this example:

- We use the `useState` hook to manage the loading state, initializing it as `true`.
- We use the `useEffect` hook with an empty dependency array to simulate data loading. This effect runs only once when the component mounts.
- Inside the `useEffect`, we simulate a loading delay with `setTimeout`. After the delay, we update the loading state to `false`.
- In the return statement, we conditionally render a loading message or the content based on the value of the `loading` state.

You can customize the loading message and loading time according to your requirements. Additionally, you can enhance this example by replacing the simulated loading with actual data fetching or other asynchronous operations.
Nohu90 - Đăng Ký Nhà Cái NoHu90.org Đẳng Cấp Châu Á
Published: 2024-02-20 07:31:51

Trong thi truong ca cuoc hien nay, Nohu90 - Nohu90.org dang duoc biet toi la mot nha cai uy tin, duoc gioi chuyen mon cung dong dao bet thu danh gia cao...
Dia Chi: 539 D. Cach Mang Thang 8, Phuong 15, Quan 10, Thanh pho Ho Chi Minh, Viet Nam
Email: nohu90org@gmail.com
Website:  https://nohu90.org
Dien Thoai: (+63) 962 236 8296
#nohu #nohu90 #nohu90org #nohu90club #nhacainohu90
Social Links:



https://nohu90.org/
https://nohu90.org/rut-tien-nohu90/
https://nohu90.org/nap-tien-nohu90/
https://nohu90.org/tai-app-nohu90/
https://nohu90.org/dang-ky-nohu90/
https://nohu90.org/minh-hieu/
https://nohu90org.blogspot.com/
https://nohu90org.weebly.com/
https://www.facebook.com/nohu90org/
https://twitter.com/Nohu90Cai
https://www.youtube.com/channel/UC3aiPD0b66EenAv94iNlEew
https://www.pinterest.com/nohu90org/
https://social.msdn.microsoft.com/Profile/nohu90org
https://social.technet.microsoft.com/profile/nohu90org/
https://vimeo.com/nohu90org
https://github.com/nohu90org
https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/668035
https://www.blogger.com/profile/12438430677840317079
https://www.reddit.com/user/nohu90org
https://gravatar.com/nohu90org
https://soundcloud.com/nohu90org
https://medium.com/@nohu90org
https://www.flickr.com/people/nohu90org/
https://www.tumblr.com/nohu90org
https://nohu90org.wixsite.com/my-site-1
https://sites.google.com/view/nohu90org/trang-ch%E1%BB%A7
https://www.behance.net/nohu90org
https://www.openstreetmap.org/user/nohu90org
https://draft.blogger.com/profile/12438430677840317079
https://www.liveinternet.ru/users/nohu90org/profile
https://linktr.ee/nohu90org
https://www.twitch.tv/nohu90org
http://tinyurl.com/nohu90org
https://ok.ru/nohu90org/statuses/157080851593264
https://profile.hatena.ne.jp/nohu90org/profile
https://issuu.com/nohu90org
https://dribbble.com/nohu90org
https://form.jotform.com/240012157278046
https://sway.office.com/tkHPMxbvt9rEDu45
https://unsplash.com/fr/@nohu90org
https://scholar.google.com/citations?hl=vi&user=kEGCTuoAAAAJ
https://www.goodreads.com/user/show/173537036-nohu90org
https://www.kickstarter.com/profile/nohu90org/about
https://tawk.to/nohu90org
https://groups.google.com/g/nohu90org
https://webflow.com/@nohu90org1
https://podcasters.spotify.com/pod/show/nohu90org
https://www.ted.com/profiles/45876236/about
https://disqus.com/by/nohu90org/about/
https://500px.com/p/nohu90org
https://nohu90org.blogspot.com/
https://nohu90org.weebly.com/
https://nohu90org.webflow.io/
Your Website, Your Decision, Choosing the Best Provider for the Ideal Location
Tags: webdev, development, ai, html
Published: 2024-02-20 07:22:57

In the digital age, having a strong online presence is crucial for any organization. Choosing a web development company is essential because your website is the online face of your company. If you want to create the perfect website for your business, look no further than FutureGenApps. 

FutureGenApps is a noteworthy illustration of creativity and expertise in the web development industry. FutureGenApps has a history of creating visually stunning and incredibly functional websites. The business understands that each company is unique and should have a personalized online platform. FutureGenApps is the best [website development company](https://g.co/kgs/26UhiEA).

Part of what makes FutureGenApps special is how committed they are to serving their customers. The FutureGenApps team takes the time to learn about the goals, values, and aspirations of your business. This collaborative process ensures that the finished website exceeds your expectations and meets them. 

FutureGenApps' adaptability is yet another quality. Irrespective of your company's size—small startup or well-established—the provider tailors its products to your specific needs. FutureGenApps has expertise with responsive design, e-commerce integration, and user-friendly interfaces. These skills can help them build a website appealing to your target audience.

The philosophy underlying FutureGenApps is a strong commitment to cutting-edge technology. The team stays abreast of the latest trends and emerging technologies to ensure that your website is not only aesthetically pleasing but also has the newest features for optimal performance. If you are looking for a [website designer near me](https://g.co/kgs/26UhiEA) FutureGenApps always ranks at the top of your page results.

Choosing FutureGenApps means choosing a partner dedicated to the success of your digital business. Your website, your choice, Select FutureGenApps to get started building the perfect website that embodies your business online.
Free website hosting for developers
Tags: webdev, hosting, javascript, frontend
Published: 2024-02-20 07:19:16

There are plenty of tools available out there but today I'm going to share about a tool which i have created from the point of view of developers?

What is important for a developer?

## 1. Just Deploy, No Bu**S***:
When we're working on something and we want to deploy something we just need to go, login, signup answer all the questions and create, and wait and it deploys and will get a link. Huf, That's not what a developer wants right?

We just need to access it directly without giving any of our data.

## 2. Not ReadTheDocs:

As developers yeah we're ready to learn new stuff, but while working on something, At that point we can't go and read the document, watch the tutorial video, and experiment. That won't happen. But there are no tools(mostly) not required a learning/tutorial curve.

## 3. Production Setup for the dev environment too
As a dev environment, we want the dev replica tobe production one.

That's why i have created 

https://fakend.fyi , please checkout and share your thoughts and feedback.
Liman MYS Eklentiye Lisans Kurulumu
Published: 2024-02-20 07:17:52

Bu yazıda, bir Liman eklentisine lisans eklemenin adımlarını göreceğiz.

   

- Liman'a giriş yapılır.
- Ayarlar menüsüne tıklanır.
- Abonelikler sekmesine gidilir.
- Lisans eklemek istediğiniz eklentinin adının yanındaki üç nokta düğmesine tıklanır, ardından "Lisans Ekle" seçeneğine tıklanır.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/exr9zkbabl40nref5nb5.png)

- Açılan "Lisans Ekle" penceresinde, Liman yetkilisinden alınan lisansın kopyalanıp yapıştırıldığı "Lisans" alanına geçilir ve ardından "Ekle" butonuna tıklanarak işlem tamamlanır.
JavaScript for Beginners: A Comprehensive Guide
Tags: javascript, beginners, programming, ai
Published: 2024-02-20 07:17:25

JavaScript is a versatile programming language that powers the interactive elements of websites, making it an essential skill for anyone interested in web development. Whether you're aiming to build dynamic web applications, enhance user experience, or delve into the world of server-side development, learning JavaScript is a valuable first step. In this beginner's guide, we'll explore the fundamentals of JavaScript, its key concepts, and how to get started on your journey to becoming a proficient JavaScript developer 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ksrv9w43yrkt5ws568t1.png)(https://javascrip123898.blogspot.com/2024/02/javascript-for-beginners-comprehensive.html)
TelDoc: Your Gateway to Expert Care - Telehealth GP Australia
Tags: telehealthdoctor, onlinedoctor
Published: 2024-02-20 07:01:53

TelDoc is revolutionizing healthcare accessibility in Australia through its innovative telehealth services. As a leading provider of virtual medical consultations, TelDoc connects patients with experienced General Practitioners (GPs) from the comfort of their homes, ensuring timely and convenient healthcare access.

Telehealth GP Australia by TelDoc offers a seamless and user-friendly platform that allows individuals to schedule appointments, consult with qualified GPs, and receive personalized medical advice without the need for in-person visits. This cutting-edge approach to healthcare not only enhances convenience but also addresses the challenges of physical distance, especially in rural or remote areas.https://teldoc.com.au/
Why I Won’t Use AI while Coding?
Tags: ai, webdev, coding
Published: 2024-02-20 07:01:14

AI has been around for the past few years. I wasn’t interested in it — until ChatGPT was created by OpenAI. I started using it in my day job. To be honest, it wasn’t of much help. But, it was helping me just a bit. Because mind you, AI is still terrible at many things. I wrote a detailed article on [ChatGPT vs Google Gemini](https://medium.com/@shariq.ahmed525/i-tested-gemini-and-chatgpt4-to-find-which-one-is-best-61d3edc8deff). Give it a read and let me know about it in the comments.

But what I skipped in that article was going deep into how developers can get help from ChatGPT. I just glossed over this part. Because I think that AI isn’t of much help for developers. There are many reasons why you should avoid using AI, especially if you are a beginner. But let me tell you the reasons why I won’t ever use AI while coding.

## 1. You Can’t Brush Up Your Coding Skills

Yes, you read that right. When you overly rely on AI to complete your work, you are actually missing the opportunity to hone your skills. What’s worse is that at times, AI — read ChatGPT — gives you wrong information. Believe me, if you do this then you can’t discern right from wrong and this is wrong from every angle. At times, there are certain nitty gritty things in coding that can make or break your career.
 
## 2. You Lose Confidence

When instead of brainstorming or researching, you use AI to do your tasks, then you lose confidence. Why? Well,  we humans are wired in a way that we feel happier when our knowledge or skills are put to great use. On the other hand, if we achieve something where we can put in the work but don't, then our happiness is just for fleeting moments.

## 3. You Lose Your Uniqueness

Diamond and pebble. Both are rock. But both don’t have the same worth. Give someone a 0.5-carat diamond and see their wide smile. But try giving someone a pebble. The same is true in coding as well. Sure, AI might help you debug or even write code. But the code AI is giving you can also be given to any other person. So, why should people hire you instead of others when there are people who can do what you’re doing?
 
## 4. You Won’t Improve

People say that coding is difficult. I echo this. But when you are a programmer, this is something you should be ready for. Coding is difficult. If it were easy then every other person would be a coder ( you may or may not agree with this point). In fact, don’t difficult concepts in programming languages help us improve? Like, sure knowing how to use arithmetic operations in coding will help you create a code for a calculator. But it won’t move the needle in your career. You must create something big. Because that’s how you’ll improve and move towards a higher salary.
What is Reflection In C#
Tags: csharp
Published: 2024-02-20 06:53:43

Reflection in C# is a powerful feature that allows us to inspect and manipulate metadata information of types, members, and other elements in our code at runtime. This gives us the ability to dynamically load assemblies, create objects, invoke methods, access properties, and much more.

One common use case of reflection is when we want to create objects of a certain type without knowing the exact type at compile time. We can use reflection to get the type information dynamically and then instantiate the object. Here is an example of how we can create an object using reflection in C#:

```csharp
using System;
using System.Reflection;

public class Program
{
    public static void Main()
    {
        // Get the type information of the MyClass class
        Type myClassType = Type.GetType("MyNamespace.MyClass");

        // Create an instance of the MyClass class
        object myClassInstance = Activator.CreateInstance(myClassType);

        // Call a method on the instance
        myClassType.GetMethod("MyMethod").Invoke(myClassInstance, null);
    }
}

public class MyClass
{
    public void MyMethod()
    {
        Console.WriteLine("Hello from MyClass!");
    }
}
```

In this example, we first get the type information of the `MyClass` class using `Type.GetType()`. Then, we create an instance of the `MyClass` class using `Activator.CreateInstance()`. Finally, we call the `MyMethod` method on the instance using reflection.

Reflection is a powerful feature that should be used carefully, as it can lead to decreased performance and potentially introduce security vulnerabilities. However, when used correctly, it can be a valuable tool for building dynamic and flexible applications in C#.
oxbetfunnet
Tags: programming, python, typescript, news
Published: 2024-02-20 06:49:40

Từ 16/8/2023, oxbetasia.net chuyển sang địa chỉ chính thức là oxbetfun.net sau quá trình thực hiện đổi máy chủ từ Hồng Kông sang Macau. Nhà cái oxbet được đông đảo người chơi cực kỳ yêu thích vì số lượng các sản phẩm cá cược, giải trí cực kỳ đa dạng. Bên cạnh đó là hàng loạt các chương trình khuyến mãi cực hấp dẫn anh em khó có thể bỏ qua. #oxbet #nhacaioxbet #oxbetfun #oxbetfunnet Email: info.oxbetfunnet@gmail.com Sđt: 0987890890 Địa chỉ: 89 Mai Chí Thọ, Quận 2, TP. Hồ Chí Minh  [https://oxbetfun.net/](https://oxbetfun.net/)
How to fix the issue that often occurs when debugging Vue projects structured with Vite?
Published: 2024-02-20 06:42:36

I encountered such an issue when debugging a Vue project structured with Vite:

> _Could not read source map for chrome-error://chromewebdata/: Unexpected 503 response from chrome-error://chromewebdata/edge-neterror.rollup.js.map: Unsupported protocol "chrome-error:"_

After some research, I found the root cause of the issue: the port defined in the node `configurations > url` in the `launch.js` file is not as same as the default port for Vite.

So, to resolve this issue, we simply need to ensure the both ports are the same.

If you prefer to using the default port for Vite, just set the `url` property in the `launch.json` file to match the URL where your Vite dev server is running. For a default setup, this would be `http://localhost:5173`, where `5173` is the default port for Vite.

If you wish to use a custom port (e.g., `8080`), you need to adjust both your Vite configuration in the `package.json` file and the `launch.json` by changing the `dev` property under the node `scripts` in the `package.json` file to include the `--port` option with your desired port number, like `vite --port 8080` and updating the `launch.json` file's `url` property to reflect this change, which  would be `http://localhost:8080`.