public void Construction() { // arrange // act var converter = new RomanDecimalConverter(); // assert Assert.NotNull(converter); Assert.Null(converter.RomanText); Assert.Null(converter.Decimal); Assert.Null(converter.ErrorMessage); Assert.Equal("none", converter.ErrorDisplay); }
public void ConvertBinary_WithDecimalString( string initialDecimal, string expectedRoman, string expectedErrorMessage, string expectedErrorDisplay) { // arrange var converter = new RomanDecimalConverter { Decimal = initialDecimal }; // act converter.ConvertRoman(); // assert Assert.Equal(expectedRoman, converter.RomanText); Assert.Equal(expectedErrorMessage, converter.ErrorMessage); Assert.Equal(expectedErrorDisplay, converter.ErrorDisplay); }
public void ConvertDecimal_WithRomanString( string initialRoman, string expectedDecimal, string expectedErrorMessage, string expectedErrorDisplay) { // arrange var converter = new RomanDecimalConverter { RomanText = initialRoman }; // act converter.ConvertDecimal(); // assert Assert.Equal(expectedDecimal, converter.Decimal); Assert.Equal(expectedErrorMessage, converter.ErrorMessage); Assert.Equal(expectedErrorDisplay, converter.ErrorDisplay); }
public void ConvertToRoman_Clicked() { // arrange using var ctx = new TestContext(); var vm = new RomanDecimalConverter { Decimal = "7" }; ctx.Services.AddSingleton <RomanDecimalConverter>(vm); var cut = ctx.RenderComponent <RomanDecimalConvert>(); // act cut.Find("#btn-convert-roman").Click(); // assert cut.MarkupMatches(RomanDecimalConvertExpectedResults.ConvertToRomanResult); }