public void ItShouldConstruct() { //Arrange Mock <INumeralsValidator> mockNumeralsValidator = new Mock <INumeralsValidator>(); Mock <IRomansConverter> mockRomansConverter = new Mock <IRomansConverter>(); NumeralsController sut = new NumeralsController(mockNumeralsValidator.Object, mockRomansConverter.Object); //Act //Assert Assert.NotNull(sut); }
public void ItShouldReturnBadRequest(string input) { //Arrange Mock <INumeralsValidator> mockNumeralsValidator = new Mock <INumeralsValidator>(); mockNumeralsValidator.Setup(mockNumeralsValidator => mockNumeralsValidator.Validate(input)) .Returns(false); Mock <IRomansConverter> mockRomansConverter = new Mock <IRomansConverter>(); NumeralsController sut = new NumeralsController(mockNumeralsValidator.Object, mockRomansConverter.Object); //Act IActionResult result = sut.Get(input); //Assert Assert.IsType <BadRequestObjectResult>(result); }