آموزش Unit Testing در #C با xUnit
How to become a Zero to Hero in Unit Testing with C# and xUnit ?
Timeline:
Background 0:00:00
Introduction To Fluent Assertions 0:01:12
Setting Up Fluent Assertions 0:02:39
Basic Assertions with Fluent Assertions 0:09:19
Advanced Assertions with Fluent Assertions 0:20:28
Custom Assertions with Fluent Assertions 0:28:32
Test the Custom Person Assertions 0:47:56
Best Practices For Using Fluent Assertions 0:54:21
gRPC Service with .NET 7
In this video we build a gRPC service with 5 methods: Create, Read (single), List (multiple), Update and Delete. We then employ JSON transcoding (a new feature added in .NET 7) to allow our gRPC service to act as a REST based API. This allows web-based endpoints to consume our service, while at the same time continuing to allow native gRPC clients to consume as well.
⏲️ Time Codes ⏲️
- 0:33 - Welcome
- 2:00 - gRPC Overview
- 5:08 - Scaffold the prject
- 9:58 - Test "greeter" service with Postman
- 12:32 - Add package dependencies
- 14:48 - Create the Model
- 16:38 - Create DB Context & migrations
- 22:37 - Define the protobuf file
- 32:39 - Build the first service method
- 40:55 - Test method with postman
- 42:52 - Read method
- 48:42 - List method
- 52:39 - Update method
- 59:14 - Delete method
- 1:03:24 - Add the annotation files
- 1:06:07 - Annotate the first gRPC method
- 1:09:26 - Annotate remaining methods
- 1:12:42 - Test with Postman
- 1:16;00 - Patreon supporter credits
Want to learn about the latest and greatest in the 64-bit Visual Studio 2022? Join Scott Hanselman and Visual Studio product team as they take Visual Studio 2022 for a spin.
20:27 Profiling .NET apps in Visual Studio 2022
23:19 Cross platform apps with WSL and CMake in Visual Studio 2022
26:07 Testing your .NET app on Linux
28:00 Easily create CI/CD pipelines using GitHub actions with Visual Studio 2022
30:40 Balloon drop!
The conclusion of the analysis:
C# Wasm AOT still
has a long way to become a general and performant client side web
programming platform. Note: The usage of the Uno.Wasm.Bootstrap
toolchain may have affected the performance of some of the benchmarks.
Thus, this analysis should not be regarded as a benchmark of the
finalized product. However, note that the Uno platform is using ".NET 6
WebAssembly Mixed mode AOT/Interpreter" (source).
Complete Guide to Open Source - How to Contribute
⭐️ Course Contents ⭐️
⌨️ (00:00) Introduction
⌨️ (01:11) What is Open Source
⌨️ (01:46) Why you should care about Open Source
⌨️ (04:06) What is Git
⌨️ (04:56) What is GitHub
⌨️ (05:24) Example custom GitHub profile
⌨️ (06:01) GitHub features
⌨️ (13:37) GitHub Actions for Continuous Integration (CI)
⌨️ (14:49) Insights tab for more project information
⌨️ (15:04) GitHub Discussions for threaded conversations
⌨️ (15:41) GitHub Projects board like Trello
⌨️ (16:10) GitHub Wiki
⌨️ (17:15) How to find Open Source projects
⌨️ (19:40) How to write Markdown
⌨️ (27:58) Draft a Pull Request (PR)
⌨️ (29:06) Make money directly with GitHub Sponsors
⌨️ (30:15) Make money indirectly from Open Source
⌨️ (32:19) freeCodeCamp.org Open Source resources
⌨️ (34:04) Everyone is a Project Maintainer
⌨️ (39:49) How to customize your GitHub profile
⌨️ (40:46) Conclusion
AvaloniaUI v11 منتشر شد
IME (Input Method Editor) Support
Compositing Renderer
WebAssembly (WASM) Support
iOS and Android Support
Full Rich Text support
Smooth Virtualization (Reworked ItemsControl)
Performance Improvements
Control Themes, Nested Styles, and Theme Variants
Bitmap Effects
3D Transforms
AOT (Ahead-Of-Time) Compilation and Trimming
GPU Interop
Experimental Metal Support
مدلسازی نمونهی آن به صورت زیر است:
public class UIModel { public int PersianYear { set; get; } public int[] SelectedPersianMonths { set; get; } }
var model = new UIModel { PersianYear = 1391, SelectedPersianMonths = new[] { 4, 5 } };
var itemsQuery = context.Members.AsQueryable(); // Linq chaining where clauses as an `Or` instead of `And` var predicate = PredicateBuilder.False<Member>(); foreach (var month in model.SelectedPersianMonths) { var start = new DateTime(model.PersianYear, month, 1, new PersianCalendar()); var end = new DateTime(model.PersianYear, month, month <= 6 ? 31 : 30, new PersianCalendar()); // We can chain `IQueryable`s. // itemsQuery = itemsQuery.Where(x => x.JoinDate.Date >= start && x.JoinDate.Date <= end); // But it will be translated as an `AND`, not `OR` predicate = predicate.Or(x => x.JoinDate.Date >= start && x.JoinDate.Date <= end); } itemsQuery = itemsQuery.Where(predicate); var items = itemsQuery.Select(x => new { x.FirstName, x.Surname }).ToList();
SELECT [m].[FirstName], [m].[Surname] FROM [Members] AS [m] WHERE ((CONVERT (DATE, [m].[JoinDate]) >= '2012-06-21T00:00:00') AND (CONVERT (DATE, [m].[JoinDate]) <= '2012-07-21T00:00:00')) OR ((CONVERT (DATE, [m].[JoinDate]) >= '2012-07-22T00:00:00') AND (CONVERT (DATE, [m].[JoinDate]) <= '2012-08-21T00:00:00'));
انتظار این بود که در لحظاتی که دقیقه صفر و ثانیه یک و یا دقیقه 50 و ثانیه یک باشد عملیات مورد نظر (در اینجا تهیه نسخه پشتیبان صورت پذیرد ) به عبارتی در هر ساعت دو بار این شرایط مهیا میشود ولی نتیجه به صورت ذیل شد :
12:50:01 12:50:02 13:00:01 13:00:02 13:50:01 13:50:02 14:00:01 14:50:01 15:00:01 15:00:02
زمانهایی که بولد شدند قاعدتا نباید جاب اجرا میشد . احتمالا مشکل چی میتونه باشه ؟