This is the “Fundamentald of Unit Testing” article series. Our previous article was an introduction to unit testing. We have learned why unit testing is very important and defined the procedure for Test Driven Development. You can read it here.
- Fundamentals of Unit Testing: Getting Started With Unit Testing
- Fundamentals of Unit Testing: Test Your Application by Visual Studio Unit Test
- Fundamentals of Unit Testing: Understand AAA in Unit Testing
- Fundamental of Unit Testing: Understand AreEqual and AreEqual<T> in Unit Testing
- Fundamental of Unit Testing: Test Initialize and Test Setup
- Fundamentals of Unit Testing: Understand CollectionAssert() in Unit Testing
This article explains the “ExpectedException” attribute in unit testing. This attribute is used when we know that a function may throw some kind of exception. For example, if we know that the specific function will throw some kind of exception then we can use the “ExpectedException” attribute. Let's try to understand this with an example. Create one class library and unit test project and provide a reference to it. If you are very new in unit testing then I suggest you to go through the first two articles of this series.
Anyway, here is our code that we will test using a unit test application.



Emrullah DanacıPosted Jul 24, 2018, 7:35 AM
Good job sourav
Gowtham RajamanickamPosted Apr 25, 2015, 5:29 AM
good