public void TestshowMyCustomers() { Init(); EngineerBL ebl = new EngineerBL(mockcrepo, mockerepo, mockirepo); List <CustomerModel> clist = ebl.showMyCustomers(0); Assert.IsNotNull(clist); Assert.AreEqual(1, clist.Count); Assert.AreEqual(0, clist.First().customerid); }
public void TestcreateCustomer() { Init(); EngineerBL ebl = new EngineerBL(mockcrepo, mockerepo, mockirepo); CustomerModel mycustomer = new CustomerModel { customerid = 1, firstname = "new", lastname = "user", username = "******", email = "*****@*****.**", engineerid = 0, Installation = new List <int> { 0, 1 }, password = "******" }; ebl.createCustomer(mycustomer); Assert.AreEqual(2, mockcrepo.GetAll().Count); }
public void TestcreateInstallation() { Init(); EngineerBL ebl = new EngineerBL(mockcrepo, mockerepo, mockirepo); InstallationModel myinstallation = new InstallationModel { installationid = 1, customerid = 0, description = "testinstallation", serialno = "testser", latitude = 33, longitude = 44, Measurement = new List <int> { 0 } }; ebl.createInstallation(myinstallation); Assert.AreEqual(2, mockirepo.GetAll().Count); }