public void TestMethod_ProductDetail() { VendingMachineProcess vendingMachingProcess = new VendingMachineProcess(); int productSNo = 1; ProductModel result = vendingMachingProcess.FindAndReturnProduct(productSNo); Assert.AreEqual(result.Name, "Cola"); }
public void TestMethod_ProductDetail_Negative() { VendingMachineProcess vendingMachingProcess = new VendingMachineProcess(); int productSNo = 5; ProductModel result = vendingMachingProcess.FindAndReturnProduct(productSNo); string finalResult = null; if (result != null) { finalResult = result.Name; } Assert.AreEqual(finalResult, null); }