public void Should_ReturnNum_EvenWithLowerCaseParams(string romanNum, int ans) { //Given //When int integerNum = RomanConverter.ConvertRoman(romanNum); //Then integerNum.Should().Be(ans); }
public void Should_ReturnSubtractionOfNumerals(string romanNum, int answer) { //Given //When int integerNum = RomanConverter.ConvertRoman(romanNum); //Then integerNum.Should().Be(answer); }
public void Should_ThrowException_WhenGivenInvalidInput(string romanNum) { //Given //When Action action = () => RomanConverter.ConvertRoman(romanNum); //Then action.Should().Throw <KeyNotFoundException>(); }
public void Should_ThrowError_WhenNegativeValueIsGiven() { //Given string romanNum = "-V"; //When Action action = () => RomanConverter.ConvertRoman(romanNum); //Then action.Should().Throw <ApplicationException>().WithMessage("Negative Values Are Invalid"); }
public void Should_ThrowException_WhenInputIsNull() { //Given string romanNum = null; //When Action action = () => RomanConverter.ConvertRoman(romanNum); //Then action.Should().Throw <NullReferenceException>(); }
public void Should_ThrowError_WhenNumberExceedsMaxValue() { //Given string romanNum = "MMMMMMMMMMM"; //When Action action = () => RomanConverter.ConvertRoman(romanNum); //Then action.Should().Throw <ApplicationException>().WithMessage("Number exceeds max value of 3999"); }
public void Should_ReturnSumOfNumerals() { //Given string romanNum = "XVI"; //When int integerNum = RomanConverter.ConvertRoman(romanNum); //Then integerNum.Should().Be(16); }
public void Should_returnDecimalInt() { //Given string romanNum = "X"; //When int integerNum = RomanConverter.ConvertRoman(romanNum); //Then integerNum.Should().Be(10); }
public void Should_ReturnZero_IfParameterIsEmpty() { //Given string romanNum = ""; //When int integerNum = RomanConverter.ConvertRoman(romanNum); //Then integerNum.Should().Be(0); }
public void Complex_Roman_Returns_Number() { //arrage RomanConverter romanConverter = new RomanConverter(); //act int actual = romanConverter.ConvertRoman("DCXXIV"); //assert Assert.Equal(624, actual); }
public void Simple_Roman_Returns_OneDigit_Number(int expected, string value) { //arrage RomanConverter romanConverter = new RomanConverter(); //act int actual = romanConverter.ConvertRoman(value); //assert Assert.Equal(expected, actual); }
public void Roman_IsNullOrEmpty_Throws_ArgumentNullException(string value) { //arrage RomanConverter romanConverter = new RomanConverter(); //act Action actual = () => romanConverter.ConvertRoman(value); //assert Assert.Throws <ArgumentNullException>(actual); }