public void RegisterRentalTest() { Fixture fixture = new Fixture(); var payload = fixture.Build <Payload>().Create(); //Setup var mockRepo = new Mock <IRentalRepository>(); mockRepo.Setup(rep => rep.Return(payload)); var controller = new RentalController(mockRepo.Object); //Act var okRes = controller.Post(payload); // Assert Assert.Equal("Done", okRes.Value); }
public async void Test_Controller_Post() { var resultPass = await _controller.Post(new RentalModel()); Assert.NotNull(resultPass); }