コード例 #1
0
        public void Throw_if_not_hexadecimal(string hexadecimalString, string expectedNotAllowedCharacters)
        {
            Action act = () => HexadecimalService.ConvertToDecimal(hexadecimalString);

            act.Should()
            .Throw <ArgumentOutOfRangeException>()
            .WithMessage($"Only 0-9, A-F and whitespace allowed. Contains not allowed characters: {expectedNotAllowedCharacters}  ");
        }
コード例 #2
0
        public void Converter_hexadecimal_to_decimal(string hexadecimalString, string expectedDecimalString)
        {
            var result = HexadecimalService.ConvertToDecimal(hexadecimalString);

            result.Should().Be(expectedDecimalString);
        }