public void Customer_DeleteCustomer_NoEmailSession() { // Arrange var SessionMock = new TestControllerBuilder(); var Controller = new CustomerController(new CustomerBLL(new CustomerRepoStub())); SessionMock.InitializeController(Controller); Controller.Session["Email"] = null; var email = userEmail; // Act var result = (bool)Controller.DeleteCustomer(email); // Assert Assert.IsFalse(result); }
public void Customer_DeleteCustomer_Ok() { // Arrange var SessionMock = new TestControllerBuilder(); var Controller = new CustomerController(new CustomerBLL(new CustomerRepoStub())); SessionMock.InitializeController(Controller); Controller.Session["Admin"] = true; var email = userEmail; // Act var result = Controller.DeleteCustomer(email); // Assert Assert.IsTrue(result); }
public void Customer_DeleteCustomer_DeleteSelfNotAllowed() { // Arrange var SessionMock = new TestControllerBuilder(); var Controller = new CustomerController(new CustomerBLL(new CustomerRepoStub())); SessionMock.InitializeController(Controller); Controller.Session["Admin"] = true; Controller.Session["Email"] = adminEmail; var email = adminEmail; // Act var result = Controller.DeleteCustomer(email); // Assert Assert.IsFalse(result); }