public void DetailsTest() { TestDeploymentContext tdc = new TestDeploymentContext(); //adding one contract, as the contract requires a supplier id ContractDetail x = new ContractDetail() { Contract_ID = 0, Supplier_ID = 0, ContractStartDate = new DateTime(10, 05, 2019), ContractFinishDate = new DateTime(10, 05, 2020), Servicetype = Service.Waste, PriceDescription = "Hourly Price", Price = 22.00, VatRate = 0.135, PriceUpdatedate = new DateTime(01 / 01 / 2019) }; tdc.ContractDetail.Add(x); Assert.IsNotNull(x); tdc.Supplier.Add(new Supplier() { Supplier_ID = 0, SupplierNumber = "SN000", SupplierName = "Tipperary Water", SupplierAddress = "5 Cherry Orchard Industrial Estate, Ballyfermot, Dublin 10.", SupplierCounty = "Dublin", SupplierContact = "Lana kelly", SupplierEMail = "*****@*****.**" }); var controller = new SuppliersController(tdc); var result = controller.Details(0); Assert.IsNotNull(result); Assert.IsInstanceOfType(result, typeof(ViewResult)); Supplier y = new Supplier(); //(Supplier)((ViewResult)result).Model; Assert.AreEqual(y.SupplierName, "Tipperary Water"); }
public void IndexTest() { TestDeploymentContext tdc = new TestDeploymentContext(); var controller = new ContractDetailController(tdc); var result = controller.Index(); Assert.IsNotNull(result); }