예제 #1
0
        public void ItShouldThrow(char letter)
        {
            //Arrange
            RomansConverter sut = new RomansConverter();

            //Act

            //Assert
            Assert.Throws <ArgumentException>(() => sut.LookupChar(letter));
        }
예제 #2
0
        public void ItShouldConstruct()
        {
            //Arrange
            RomansConverter sut = new RomansConverter();

            //Act

            //Assert
            Assert.NotNull(sut);
        }
예제 #3
0
        public void ItShouldReturn0IfInvalidChar(char letter)
        {
            //Arrange
            RomansConverter sut = new RomansConverter();

            //Act
            int result = sut.FromNumeral(letter.ToString());

            //Assert
            Assert.True(result == 0);
        }
예제 #4
0
        public void ItShouldLookup(
            char letter,
            int expectedValue)
        {
            //Arrange
            RomansConverter sut = new RomansConverter();

            //Act
            int returnedValue = sut.LookupChar(letter);

            //Assert
            Assert.Equal(expectedValue, returnedValue);
        }
예제 #5
0
        public void ItShouldConvert(
            string input,
            int expected)
        {
            //Arrange
            RomansConverter sut = new RomansConverter();

            //Act
            int result = sut.FromNumeral(input);

            //Assert
            Assert.Equal(expected, result);
        }
예제 #6
0
        public void ItShouldReturnEmptyStringIfInvalidInput(
            int digit,
            string expected)
        {
            //Arrange
            RomansConverter sut = new RomansConverter();

            //Act
            string result = sut.ToNumeral(digit);

            //Assert
            expected.Should().BeEquivalentTo(result);
        }