.Net framework

Home|Tag: .Net framework

Assert.Throws<> Over ExpectedException

Writing unit tests that expects a given type of exception under given circumstances is essential for any test suite. Although it is useful to use the correct assertion types when testing for exceptions. In this post I will provide some guidance on why to use Assert.Throws<>() instead of ExpectedException. Using the ExpectedException: In

ErrorProvider providing localization difficulties

The .Net framework provides several mechanisms for indicating invalid user inputs. You can use a MessageBox to indicate that the state of the control is not valid. A MessageBox can then provide the reason and remedies in the popup dialog box. Having several controls that needs user input this approach can be both cumbersome