public async void PostMethodInserCustomer() { // Arrange var mockRepository = new Mock <ICustomerService>(); var controller = new CustomerController(mockRepository.Object); // Act // IHttpActionResult actionResult = controller.AddCustomerDetails(new CustomerDetails { Password = "", firstName = "Product1", LastName = "", BilingAddress = "", DeliveryAddress = "", DeliveryCity = "", MobileNo = "", Email = "" }); bool status = await controller.AddCustomerDetails(new CustomerDetails { Password = "******", firstName = "Lashika", LastName = "Dilanthi", BilingAddress = "kurunegala", DeliveryAddress = "Kurunegala", DeliveryCity = "Kurunegala", MobileNo = "0779886520", Email = "*****@*****.**" }); // var createdResult = actionResult as CreatedAtRouteNegotiatedContentResult<CustomerDetails>; //Assert Assert.AreEqual(true, status); }