Welcome to the FoxLearn
Today we will learn How to Create and Run a Unit Test
First, You need to create a simple BankAccount class, then create a unit test.
The unit test allows you to check that your code is working as expected by creating and running unit tests
It’s called unit testing because you break down the functionality of your program into discrete testable behaviors that you can test as individual units
Visual Studio Test Explorer provides a flexible and efficient way to run your unit tests and view their results in Visual Studio
Visual Studio installs the Microsoft unit testing frameworks for managed and native code
Use a unit testing framework to create unit tests, run them, and report the results of these tests
Rerun unit tests when you make changes to test that your code is still working correctly
When you use Visual Studio Enterprise, you can run tests automatically after every build
Unit testing has the greatest effect on the quality of your code when it's an integral part of your software development workflow
As soon as you write a function or other block of application code
create unit tests that verify the behavior of the code in response to standard, boundary
and incorrect cases of input data, and that check any explicit or implicit assumptions made by the code
With test driven development, you create the unit tests before you write the code
so you use the unit tests as both design documentation and functional specifications
You can quickly generate test projects and test methods from your code, or manually create the tests as you need them
When you use IntelliTest to explore your .NET code, you can generate test data and a suite of unit tests
For every statement in the code, a test input is generated that will execute that statement
You can change debit method and run test again
Thank you for watching this video