Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }