Category: .NET
-
Watch2–part7–full test
Watch2 NuGet Package The Watch2 NuGet package extends the functionality of dotnet watch by adding features such as console clearing and delay handling. It outputs the same information as dotnet watch. 1. Wrapper Interfaces To facilitate testing,it is necessary to wrap various process creation classes from .NET (e.g.,Process => ProcessWrapper,ProcessStartInfo => ProcessStartInfoWrapper). This allows for…
-
Watch2–part 6- options
The Watch2 package passes all the command line arguments to the dotnet watch. So how can it have its own settings? Simple: by reading a watch.json file that is in the same folder where it is executing. 1. Testing I was considering how to perform the testing,and there were two options: Microsoft File Providers: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/file-providers?view=aspnetcore-8.0…
-
Watch2- part 5–DI
The Watch2 NuGet package project now has interfaces,making it test-friendly and ready for action. To make life easier,we’ve sprinkled some Dependency Injection (DI) magic throughout the project. Classes have been refactored to embrace constructor injection,ensuring all necessary interfaces are on board. The DI container has been set up in `Program.cs`,making dependency resolution a breeze. The…
-
Watch2–part 4–CI and CD
Now I want to do build and auto-deployment as a Nuget Package( at https://www.nuget.org/packages/watch2 ) The most simple build action on GitHub Actions is simple example of how to do it. However,I want to do more than that. I want to build,test and deploy on demand the Nuget package to Nuget.org. However,the building should be…
-
Watch2- part 3 -refactoring to interfaces and test
The Watch2 just intercepts the dotnet watch,adds a clear console,and a delay to give a breather between running the app and the tests. So I need to have tests – if I want to be sure what the software does and to modify it without summoning the coding gremlins. More importantly,the output from dotnet watch…
-
Watch2- part 2- first fast implementation
The first attempt to writing the code was very fast – and,surely,not testable. (Speedy Gonzales would be proud!) Some observations: 1. If you start any process inside a console application,you should intercept the cancel signal and stop the process. This is done by using the CancelKeyPress event of the Console class. This is important because…
-
Watch2–part 1–idea
I frequently use .NET Watch for two main reasons: Running .NET applications during development. Executing tests. Seriously,if you haven’t tried .NET Watch,you’re missing out. It’s like having a personal assistant who never sleeps compiling code . For more info,check out Microsoft’s documentation at https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-watch But,like all good things,it comes with a couple of quirks: The…
-
RSCG – RazorSlices
RSCG – RazorSlices name RazorSlices nuget https://www.nuget.org/packages/RazorSlices/ link https://github.com/DamianEdwards/RazorSlices author Damiam Edwards Generating html from razor templates. Attention: generates IHttpResult,not html string. This is how you can use RazorSlices . The code that you start with is The code that you will use is The code that is generated is Code…
-
RSCG – TypedSignalR.Client
RSCG – TypedSignalR.Client name TypedSignalR.Client nuget https://www.nuget.org/packages/TypedSignalR.Client/ link https://github.com/nenoNaninu/TypedSignalR.Client author nenoNaninu Creating typed Signal R clients This is how you can use TypedSignalR.Client . The code that you start with is The code that you will use is The code that is generated is Code and pdf at https://ignatandrei.github.io/RSCG_Examples/v2/docs/TypedSignalR.Client
-
RSCG – MinimalHelpers.Routing.Analyzers
RSCG – MinimalHelpers.Routing.Analyzers name MinimalHelpers.Routing.Analyzers nuget https://www.nuget.org/packages/MinimalHelpers.Routing.Analyzers/ link https://github.com/marcominerva/MinimalHelpers author Maroc Minerva Controller like API registering This is how you can use MinimalHelpers.Routing.Analyzers . The code that you start with is The code that you will use is The code that is generated is Code and pdf at https://ignatandrei.github.io/RSCG_Examples/v2/docs/MinimalHelpers.Routing.Analyzers