public void ValidateSedol_InvalidChecksumWithUserDefined_ReturnsResultWithAppropriateError() { string input = "9234516"; ISedolValidatorResult result = sedolValidator.ValidateSedol(input); Assert.AreEqual(input, result.InputString); Assert.IsFalse(result.IsValidSedol); Assert.IsTrue(result.IsUserDefined); Assert.AreEqual(ChecksumValidationErrorMessage, result.ValidationDetails); }
public void ValidateSedol_InvalidCharsWithStartingNine_ReturnsResultWithAppropriateError() { string input = "92345!6"; ISedolValidatorResult result = sedolValidator.ValidateSedol(input); Assert.AreEqual(input, result.InputString); Assert.IsFalse(result.IsValidSedol); Assert.IsFalse(result.IsUserDefined); Assert.AreEqual(InvalidCharsErrorMessage, result.ValidationDetails); }
public void ValidateSedol_MoreThanSevenChars_ReturnsResultWithAppropriateError() { string input = "92345abce0"; ISedolValidatorResult result = sedolValidator.ValidateSedol(input); Assert.AreEqual(input, result.InputString); Assert.IsFalse(result.IsValidSedol); Assert.IsFalse(result.IsUserDefined); Assert.AreEqual(LengthValidationErrorMessage, result.ValidationDetails); }
public void ValidateSedol_EmptyInput_ReturnsResultWithAppropriateError() { string input = string.Empty; ISedolValidatorResult result = sedolValidator.ValidateSedol(input); Assert.AreEqual(string.Empty, result.InputString); Assert.IsFalse(result.IsValidSedol); Assert.IsFalse(result.IsUserDefined); Assert.AreEqual(LengthValidationErrorMessage, result.ValidationDetails); }
public void ValidateSedol_ValidChecksumWithNonUserDefined_ReturnsValidResultWithoutAnyErrorMessage() { string input = "81C3459"; ISedolValidatorResult result = sedolValidator.ValidateSedol(input); Assert.AreEqual(input, result.InputString); Assert.IsTrue(result.IsValidSedol); Assert.IsFalse(result.IsUserDefined); Assert.IsNull(result.ValidationDetails); }
static void Main(string[] args) { ISedolValidator sedolValidator = new SedolValidator(); Console.WriteLine("Enter an input SEDOL"); string input = Console.ReadLine(); ISedolValidatorResult result = sedolValidator.ValidateSedol(input); Console.WriteLine($"{result.InputString}|{result.IsValidSedol}|{result.IsUserDefined}|{result.ValidationDetails}"); }