예제 #1
0
        public void Throw_if_not_decimal_input_for_binary(string decimalString, string expectedNotAllowedCharacters)
        {
            Action act = () => DecimalService.ConvertToBinary(decimalString);

            act.Should()
            .Throw <ArgumentOutOfRangeException>()
            .WithMessage($"Only 0-9 and whitespace allowed. Contains not allowed characters: {expectedNotAllowedCharacters}  ");
        }
예제 #2
0
        public void Convert_decimal_to_binary(string decimalString, string expectedBinaryString)
        {
            var result = DecimalService.ConvertToBinary(decimalString);

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