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