1.

Can We Start With A Simple Nunit Example?

Answer»

Ok so let’s say we want to do unit testing for a simple class ‘clsInvoiceCalculation’ shown below. This class calculates total cost by taking PER PRODUCT cost and NUMBER of products as input.

public class clsInvoiceCalculation
{
public int CalculateCost(int intPerProductCost, int intNumberOfProducts)
{
return intPerProductCost * intNumberOfProducts;
}
}

Let’s say we want to execute the below TEST case on the above class using NUNIT.

Ok so let’s say we want to do unit testing for a simple class ‘clsInvoiceCalculation’ shown below. This class calculates total cost by taking per product cost and number of products as input.

public class clsInvoiceCalculation
{
public int CalculateCost(int intPerProductCost, int intNumberOfProducts)
{
return intPerProductCost * intNumberOfProducts;
}
}

Let’s say we want to execute the below test case on the above class using NUNIT.



Discussion

No Comment Found