Exemplo n.º 1
0
                public void GivenX_ReturnsY(string numerals, int expected)
                {
                    //arrange
                    var roman = new Roman();
                    //act
                    var actual = roman.ToInteger(numerals);

                    //assert
                    Assert.That(actual, Is.EqualTo(expected));
                }
Exemplo n.º 2
0
                public void GivenIV_Returns4()
                {
                    //arrange
                    var roman = new Roman();
                    //act
                    var actual = roman.ToInteger("IV");

                    //assert
                    Assert.That(actual, Is.EqualTo(4));
                }
Exemplo n.º 3
0
            public void GivenEmptyString_Returns0()
            {
                //arrange
                var roman = new Roman();
                //act
                var actual = roman.ToInteger("");

                //assert
                Assert.That(actual, Is.EqualTo(0));
            }
Exemplo n.º 4
0
            public void GivenInvalidCombination_Throws()
            {
                //arrange
                var roman = new Roman();

                //act
                //assert
                Assert.That(() => roman.ToInteger("IIII"), Throws.TypeOf <ArgumentOutOfRangeException>()
                            .With.Property(nameof(ArgumentOutOfRangeException.ParamName))
                            .EqualTo("romanNumerals"));
            }