Posts

Showing posts from May, 2014

Association-Aggregation-Composition-Dependency

http://www.codeproject.com/Articles/777540/Association-Aggregation-Composition-Dependency-and

MVC Unit Testing

Image
http://www.codeproject.com/Articles/763928/MVC-Unit-Testing-Unleashed Basic example of Unit Testing Step 1. Create a class library which need to be tested with following code block.  Collapse  |  Copy Code public class CustomMaths { public int Add( int num1, int num2) { return Number1 + Number2; } } Step 2. Create Unit Testing Project as Follows Step 3. Add reference of previous class library to this newly created project Step 4. Create Test class as follows  Collapse  |  Copy Code [TestClass] public class TestMathsClass { [TestMethod] public void TestAdd() { // Arrange CustomMaths maths = new CustomMaths( 6 , 5 ); // Act int result = maths.Add(); // Assert Assert.AreEqual< int >( 11 , result); } }