Monday, May 26, 2014

Association-Aggregation-Composition-Dependency

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

Sunday, May 18, 2014

MVC Unit Testing

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.
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
[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);
    }
}

Driving

 https://youtube.com/shorts/5Ac2qZHrApU?si=_X-G7pJFHiZoD-s7 https://www.youtube.com/watch?v=f6pSsex87oU