コード例 #1
0
        public void ToRomanNumeral_WhenNumberEquals599_ReturnsDLXXXXVIIII()
        {
            var convert = new RomanNumeralConverter();
            string result = convert.ToRomanNumeral(599);

            Assert.AreEqual("DLXXXXVIIII", result);
        }
コード例 #2
0
        public void ToRomanNumeral_WhenNumberEquals55_ReturnsLV()
        {
            var convert = new RomanNumeralConverter();
            string result = convert.ToRomanNumeral(55);

            Assert.AreEqual("LV", result);
        }
コード例 #3
0
        public void ToRomanNumeral_WhenNumberEquals2013_ReturnsMMXIII()
        {
            var convert = new RomanNumeralConverter();
            string result = convert.ToRomanNumeral(2013);

            Assert.AreEqual("MMXIII", result);
        }
コード例 #4
0
        public void ToRomanNumeral_WhenNumberEquals500_ReturnsD()
        {
            var convert = new RomanNumeralConverter();
            string result = convert.ToRomanNumeral(500);

            Assert.AreEqual("D", result);
        }
コード例 #5
0
        public void ToRomanNumeral_WhenNumberEquals1_ReturnsI()
        {
            var convert = new RomanNumeralConverter();
            string result = convert.ToRomanNumeral(1);

            Assert.AreEqual("I", result);
        }
コード例 #6
0
        public void convert_44_to_xliv()
        {
            // Arrange
            var converter      = new RomanNumeralConverter();
            var input          = 44;
            var expectedResult = "XLIV";

            // Act
            var actualResult = converter.ToRomanNumeral(input);

            // Assert
            Assert.Equal(expectedResult, actualResult);
        }
コード例 #7
0
        public void convert_498_to_cdxcviii()
        {
            // Arrange
            var converter      = new RomanNumeralConverter();
            var input          = 498;
            var expectedResult = "CDXCVIII";

            // Act
            var actualResult = converter.ToRomanNumeral(input);

            // Assert
            Assert.Equal(expectedResult, actualResult);
        }
コード例 #8
0
        public void convert_number_less_than_4_to_roman_numeral()
        {
            // Arrange
            var converter      = new RomanNumeralConverter();
            var input          = 1;
            var expectedResult = "I";

            // Act
            var actualResult = converter.ToRomanNumeral(input);

            // Assert
            Assert.Equal(expectedResult, actualResult);
        }
コード例 #9
0
        public void convert_29_to_xxix()
        {
            // Arrange
            var converter      = new RomanNumeralConverter();
            var input          = 29;
            var expectedResult = "XXIX";

            // Act
            var actualResult = converter.ToRomanNumeral(input);

            // Assert
            Assert.Equal(expectedResult, actualResult);
        }
コード例 #10
0
        public void convert_3999_to_mmmcmxcix()
        {
            // Arrange
            var converter      = new RomanNumeralConverter();
            var input          = 3999;
            var expectedResult = "MMMCMXCIX";

            // Act
            var actualResult = converter.ToRomanNumeral(input);

            // Assert
            Assert.Equal(expectedResult, actualResult);
        }
コード例 #11
0
        public void convert_16_to_xvi()
        {
            // Arrange
            var converter      = new RomanNumeralConverter();
            var input          = 16;
            var expectedResult = "XVI";

            // Act
            var actualResult = converter.ToRomanNumeral(input);

            // Assert
            Assert.Equal(expectedResult, actualResult);
        }
コード例 #12
0
        public void convert_891_to_dcccxci()
        {
            // Arrange
            var converter      = new RomanNumeralConverter();
            var input          = 891;
            var expectedResult = "DCCCXCI";

            // Act
            var actualResult = converter.ToRomanNumeral(input);

            // Assert
            Assert.Equal(expectedResult, actualResult);
        }
コード例 #13
0
        public void convert_1023_to_mxxiii()
        {
            // Arrange
            var converter      = new RomanNumeralConverter();
            var input          = 1023;
            var expectedResult = "MXXIII";

            // Act
            var actualResult = converter.ToRomanNumeral(input);

            // Assert
            Assert.Equal(expectedResult, actualResult);
        }
コード例 #14
0
        public void convert_500_to_d()
        {
            // Arrange
            var converter      = new RomanNumeralConverter();
            var input          = 500;
            var expectedResult = "D";

            // Act
            var actualResult = converter.ToRomanNumeral(input);

            // Assert
            Assert.Equal(expectedResult, actualResult);
        }
コード例 #15
0
 public void ToRomanNumeral_WhenNumberIsGreaterThan3000_ThrowsIndexOutOfRangeException()
 {
     var convert = new RomanNumeralConverter();
     string result = convert.ToRomanNumeral(3001);
 }
コード例 #16
0
            public void WhenNumberIsPositive_ThenReturnNumeral(int number, string expected)
            {
                var result = RomanNumeralConverter.ToRomanNumeral(number);

                Assert.That(result, Is.EqualTo(expected));
            }
コード例 #17
0
 public void WhenIsZeroOrMinusNumber_ThenThrowException(int number)
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => RomanNumeralConverter.ToRomanNumeral(number));
 }
コード例 #18
0
 public void ToRomanNumeral_WhenNumberIsLessThan1_ThrowsIndexOutOfRangeException()
 {
     var convert = new RomanNumeralConverter();
     string result = convert.ToRomanNumeral(0);
 }