public void Throw_if_not_binary_input(string binaryString, string expectedNotAllowedCharacters) { Action act = () => BinaryService.BinaryToDecimal(binaryString); act.Should() .Throw <ArgumentOutOfRangeException>() .WithMessage($"Only 1, 0 and whitespace allowed. Contains not allowed characters: {expectedNotAllowedCharacters} "); }
private static List <string> SplitIntoNibbles(string binaryString) { binaryString = SeparatorService.RemoveSeparatorBlanks(binaryString); binaryString = BinaryService.AddZerosToFillHighestNibbleWithZeros(binaryString); binaryString = SeparatorService.AddSeparatorBlanks(binaryString, 4); return(binaryString.Split(" ") .Reverse() .ToList()); }
public void Converter_binary_to_decimal(string binaryString, string expectedDecimalString) { var result = BinaryService.BinaryToDecimal(binaryString); result.Should().Be(expectedDecimalString); }
public ServiceTests() { _customBinaryService = new BinaryService(); _customVariableService = new VariableService(); _chromeConfig = new ChromeConfig(); }
public CustomServiceTests() { _customBinaryService = new BinaryService(); _customVariableService = new VariableService(); }