Пример #1
0
        public void CreateTest()
        {
            CustomerDataDAL dal    = new CustomerDataDAL(ConfigurationManager.ConnectionStrings["ITCDB"].ConnectionString);
            var             result = dal.CreateUser(new CustomerDataDTO
            {
                CustName     = "Some Cust Name",
                CustSurname  = "Surname",
                CustEmail    = "*****@*****.**",
                CustPhone    = 000000000,
                CustAddress  = "Address",
                CustPassword = Encoding.ASCII.GetBytes("1234567"),
                RoleId       = 1
            });

            Assert.IsTrue(result.CustomerDataId != 0, "somethig goes wong...");
        }
Пример #2
0
        public void GetAllCustomerTest()
        {
            CustomerDataDAL dal    = new CustomerDataDAL(ConfigurationManager.ConnectionStrings["ITCDB"].ConnectionString);
            var             result = dal.CreateUser(new CustomerDataDTO
            {
                CustName     = "SomeCustName",
                CustSurname  = "Surname",
                CustEmail    = "*****@*****.**",
                CustPhone    = 000100000,
                CustAddress  = "Address",
                CustPassword = Encoding.ASCII.GetBytes("1234567"),
                RoleId       = 1
            });
            var categories = dal.GetAllUsers();

            Assert.AreEqual(1, categories.Count(x => x.CustName == "SomeCustName"));
        }
 public CustomerDataService()
 {
     customerDataDAL = new CustomerDataDAL();
 }