예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }