public IActionResult ActivatePhoneNumber(string phoneNumber)
 {
     try
     {
         var customerCollection = _customerService.ActivatePhoneNumber(phoneNumber);
         return(Ok(customerCollection));
     }
     catch (Exception ex)
     {
         return(NotFound(ex));
     }
 }
Beispiel #2
0
        public void Give_user_wants_to_Activate_a_unexisting_phone_number_Then_the_phone_number_should_not_activate()
        {
            using (var ctx = new ApiContext(new DbContextOptionsBuilder <ApiContext>().UseInMemoryDatabase(databaseName: "activate_number_not").Options))
            {
                //arrange
                SetUpData(ctx);
                _service = new CustomerService(new CustomerRepository(ctx));

                //act
                var result = _service.ActivatePhoneNumber("07");

                //assert
                result.Should().BeFalse();
            }
        }