public void Octal_Validator_Test() { IValidator validator = new Implementations.Validator(); // valid inputs: validator.IsValidOctal("1234567.1234567").Should().BeTrue(); validator.IsValidOctal("1234567.0").Should().BeTrue(); // invalid inputs validator.IsValidOctal("1234567.1234567.1234567").Should().BeFalse(); validator.IsValidOctal(".1234567").Should().BeFalse(); validator.IsValidOctal("1234567.").Should().BeFalse(); validator.IsValidOctal("1234567").Should().BeFalse(); validator.IsValidOctal(",1234567").Should().BeFalse(); validator.IsValidOctal("1234567,1234567").Should().BeFalse(); validator.IsValidOctal("1234567,").Should().BeFalse(); validator.IsValidOctal("1234567.1234567.1234567").Should().BeFalse(); validator.IsValidOctal(".1234567").Should().BeFalse(); validator.IsValidOctal("1234567.").Should().BeFalse(); validator.IsValidOctal("1234567").Should().BeFalse(); validator.IsValidOctal(",1234567").Should().BeFalse(); validator.IsValidOctal("1234567,1234567").Should().BeFalse(); validator.IsValidOctal("1234567,").Should().BeFalse(); }
public void Binary_Validator_Test() { IValidator validator = new Implementations.Validator(); // valid inputs: validator.IsValidBinary("111.111").Should().BeTrue(); validator.IsValidBinary("111.0").Should().BeTrue(); // invalid inputs validator.IsValidBinary("111.111.111").Should().BeFalse(); validator.IsValidBinary(".111").Should().BeFalse(); validator.IsValidBinary("111.").Should().BeFalse(); validator.IsValidBinary("111").Should().BeFalse(); validator.IsValidBinary(",111").Should().BeFalse(); validator.IsValidBinary("111,111").Should().BeFalse(); validator.IsValidBinary("111,").Should().BeFalse(); validator.IsValidBinary("112.112.112").Should().BeFalse(); validator.IsValidBinary(".112").Should().BeFalse(); validator.IsValidBinary("112.").Should().BeFalse(); validator.IsValidBinary("112").Should().BeFalse(); validator.IsValidBinary(",112").Should().BeFalse(); validator.IsValidBinary("121,121").Should().BeFalse(); validator.IsValidBinary("211,").Should().BeFalse(); }
public void Decimal_Validator_Test() { IValidator validator = new Implementations.Validator(); // valid inputs: validator.IsValidDecimal("123456789.123456789").Should().BeTrue(); validator.IsValidDecimal("123456789.0").Should().BeTrue(); // invalid inputs validator.IsValidDecimal("123456789.123456789.123456789").Should().BeFalse(); validator.IsValidDecimal(".123456789").Should().BeFalse(); validator.IsValidDecimal("123456789.").Should().BeFalse(); validator.IsValidDecimal("123456789").Should().BeFalse(); validator.IsValidDecimal(",123456789").Should().BeFalse(); validator.IsValidDecimal("123456789,123456789").Should().BeFalse(); validator.IsValidDecimal("123456789,").Should().BeFalse(); validator.IsValidDecimal("123456789.123456789.123456789").Should().BeFalse(); validator.IsValidDecimal(".123456789").Should().BeFalse(); validator.IsValidDecimal("123456789.").Should().BeFalse(); validator.IsValidDecimal("123456789").Should().BeFalse(); validator.IsValidDecimal(",123456789").Should().BeFalse(); validator.IsValidDecimal("123456789,123456789").Should().BeFalse(); validator.IsValidDecimal("123456789,").Should().BeFalse(); }
public void Is_Valid_Hexadecimal_Test() { IValidator validator = new Implementations.Validator(); // valid inputs: validator.IsValidHexadecimal("123456789ABCDEF.123456789ABCDEF").Should().BeTrue(); validator.IsValidHexadecimal("123456789ABCDEF.0").Should().BeTrue(); // invalid inputs validator.IsValidHexadecimal("123456789ABCDEF.123456789ABCDEF.123456789ABCDEF").Should().BeFalse(); validator.IsValidHexadecimal(".123456789ABCDEF").Should().BeFalse(); validator.IsValidHexadecimal("123456789ABCDEF.").Should().BeFalse(); validator.IsValidHexadecimal("123456789ABCDEF").Should().BeFalse(); validator.IsValidHexadecimal(",123456789ABCDEF").Should().BeFalse(); validator.IsValidHexadecimal("123456789ABCDEF,123456789ABCDEF").Should().BeFalse(); validator.IsValidHexadecimal("123456789ABCDEF,").Should().BeFalse(); validator.IsValidHexadecimal("123456789ABCDEF.123456789ABCDEF.123456789ABCDEF").Should().BeFalse(); validator.IsValidHexadecimal(".123456789ABCDEF").Should().BeFalse(); validator.IsValidHexadecimal("123456789ABCDEF.").Should().BeFalse(); validator.IsValidHexadecimal("123456789ABCDEF").Should().BeFalse(); validator.IsValidHexadecimal(",123456789ABCDEF").Should().BeFalse(); validator.IsValidHexadecimal("123456789ABCDEF,123456789ABCDEF").Should().BeFalse(); validator.IsValidHexadecimal("123456789ABCDEF,").Should().BeFalse(); }