// Assert that a namespace of 7 characters (just right) will fail validation public void Validate_CorrectNameSpace() { SCTIdGenerator IDgenerator = new SCTIdGenerator(1234567); bool validNameSpace = IDgenerator.IsValidNamespace(); Assert.IsTrue(validNameSpace); }
// Assert that a namespace of 8 characters (too long) will fail validation public void Validate_TooLongNameSpace() { SCTIdGenerator IDgenerator = new SCTIdGenerator(12345678); bool validNameSpace = IDgenerator.IsValidNamespace(); Assert.IsFalse(validNameSpace); }
private void ValidateARandomlySizedNameSpace(int ns) { SCTIdGenerator IDgenerator = new SCTIdGenerator(ns); bool validNameSpace = IDgenerator.IsValidNamespace(); //asserts differently depending on ns Size. if (ns.ToString().Length < 7) { Assert.IsFalse(validNameSpace); } else if (ns.ToString().Length > 7) { Assert.IsFalse(validNameSpace); } else { Assert.IsTrue(validNameSpace); } }