示例#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);
     }
 }
 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);
        }