How to use Assert in MSTest for Unit Testing (C# 11/.NET 7)



How to use Assert in MSTest for Unit Testing (C# 11/.NET 7)

How to use Assert in MSTest for Unit Testing (C# 11/.NET 7)

00:00 – Introduction to MSTest
00:25 – NuGet packages for MSTest
01:00 – Main attributes for MSTest
01:20 – Using Assert to assert test results
03:30 – Using delta with Assert.AreEqual
04:50 – Using Assert.AreSame
06:22 – Using Assert.IsInstanceOfType
07:12 – Using Assert.IsNull
07:42 – Using Assert.ThrowsException

#csharp #dotnet7 #dotnet #csharp11 #unittesting #mstest

Some of my popular videos:

Elasticsearch with .NET and introduction: https://www.youtube.com/watch?v=9tkrDqMbFMg&t=0s

Hangfire Scheduling an introduction: https://www.youtube.com/watch?v=sQyY0xvJ4-o&t=0s

ASP.NET Core Authentication with JWT (JSON Web Token): https://www.youtube.com/watch?v=vWkPdurauaA&t=0s

Running Background tasks using IHostedService and BackgroundService (In ASP.NET Core 3.1): https://www.youtube.com/watch?v=1Fe7QD7Ovi8&t=0s

How to build an API Gateway in ASP.NET Core using Ocelot (Build API Gateway in a few minutes): https://www.youtube.com/watch?v=hlUGZ6Hmv6s&t=0s

My blog site: https://dotnetcorecentral.com