public void AuthenticateCustomerTest() { //Arrange var seedDB = new List <CustomerModelDAL>(); var seed = new CustomerModelDAL { Email = "*****@*****.**", Password = PasswordHelperTool.PasswordSHA256Hasher("password"), FirstName = "First", LastName = "Last" }; seedDB.Add(seed); var controller = new CustomerUsersLogic(new CustomerDALStub(seedDB)); var rightInput1 = "*****@*****.**"; var rightInput2 = "password"; var wrongInput1 = ""; var wrongInput2 = ""; //Act var result1 = controller.AuthenticateCustomer(rightInput1, rightInput2); var result2 = controller.AuthenticateCustomer(wrongInput1, wrongInput2); //Assert Assert.IsTrue(result1 && !result2); }
public void GetAllTest() { //Arrange var seedDB = new List <CustomerModelDAL>(); var seed = new CustomerModelDAL { Email = "*****@*****.**", Password = PasswordHelperTool.PasswordSHA256Hasher("password"), FirstName = "First", LastName = "Last" }; seedDB.Add(seed); var controller = new CustomerUsersLogic(new CustomerDALStub(seedDB)); //Act var result = controller.GetAll(); //Assert Assert.IsNotNull(result); //Double check }
public void UpdateTest() { var seedDB = new List <CustomerModelDAL>(); var seed = new CustomerModelDAL { Email = "*****@*****.**", Password = PasswordHelperTool.PasswordSHA256Hasher("password"), FirstName = "First", LastName = "Last" }; seedDB.Add(seed); //Arrange var controller = new CustomerUsersLogic(new CustomerDALStub(seedDB)); var rightInput = new CustomerModelBLL { Email = "*****@*****.**", Password = "******", FirstName = "First", LastName = "Last", MovieRentals = null }; var wrongInput = new CustomerModelBLL { Email = "", Password = "", FirstName = "", LastName = "", MovieRentals = null }; //Act var result1 = controller.Create(rightInput); var result2 = controller.Create(wrongInput); //Assert Assert.IsTrue(result1 && !result2); }
public HomeController() { _moviesLogic = new MoviesLogic(); _customerUsersLogic = new CustomerUsersLogic(); _movieOrdersLogic = new MovieOrdersLogic(); }
public CustomerAdministrationController() { _customerUsersLogic = new CustomerUsersLogic(); }
public MyPageController() { _customerUserLogic = new CustomerUsersLogic(); }