Пример #1
0
        public async Task AddCustomer_New_ReturnTrueAsync()
        {
            //Arrange
            var customerModel = new CustomerModel()
            {
                FirstName = "Rachelly",
                LastName  = "Lamberger",
                Email     = "*****@*****.**",
                Password  = "******",
            };
            var emailVerificationModel = new EmailVerificationModel()
            {
                VerificationCode = 1234,
                Email            = "*****@*****.**",
            };
            var verificationHelperModel = new VerificationHelperModel()
            {
                Customer          = customerModel,
                EmailVerification = emailVerificationModel
            };

            //Act
            var result = await _service.AddCustomer(verificationHelperModel);

            //Assert
            Assert.True(result);
        }
Пример #2
0
 public bool PostCustomer([FromBody] CustomerDTO customer)
 {
     try
     {
         return(_service.AddCustomer(_mapper.Map <CustomerModel>(customer)));
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Пример #3
0
 public async Task <bool> PostCustomer([FromBody] CustomerDTO customer)
 {
     try
     {
         return(await _service.AddCustomer(_mapper.Map <VerificationHelperModel>(customer)));
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Пример #4
0
        public void AddCustomer_New_ReturnTrue()
        {
            //Arrange
            var customerModel = new CustomerModel()
            {
                FirstName = "Rachelly",
                LastName  = "Lamberger",
                Email     = "*****@*****.**",
                Password  = "******"
            };

            //Act
            var result = _service.AddCustomer(customerModel);

            //Assert
            Assert.True(result);
        }