//Generate a random ConceptId, that can be used for the remaining tests public void GenerateArtificalConceptId() { Random rnd = new Random(); ns = rnd.Next(1000000, 9999999); SCTIdGenerator IDgenerator = new SCTIdGenerator(ns); ArtificalConceptId = IDgenerator.GenerateConceptId(); }
static void Main(string[] args) { int ns = 1223221; SCTIdGenerator foo = new SCTIdGenerator(ns); SCTIdRepository Repo = new SCTIdRepository(ns); Console.WriteLine("NameSpace =" + ns.ToString()); string bar = foo.GenerateConceptId().ToString(); Console.WriteLine("ConceptId =" + bar); Repo.ReserveId(bar); bar = foo.GenerateConceptId().ToString(); Console.WriteLine("ConceptId =" + bar); Repo.ReserveId(bar); bar = foo.GenerateConceptId().ToString(); Console.WriteLine("ConceptId =" + bar); Repo.ReserveId(bar); Console.WriteLine(); bar = foo.GenerateDescriptionId().ToString(); Console.WriteLine("DescriptionId =" + bar); Repo.ReserveId(bar); Console.WriteLine(); bar = foo.GenerateRelationshipId().ToString(); Console.WriteLine("RelationshipId =" + bar); Repo.ReserveId(bar); string codeString = "0123456789"; string beep = codeString.Substring(codeString.Length - 6, 3); Console.WriteLine("This should be 456 : " + beep); Console.WriteLine("48176007 has check digit = " + Verhoeff.GenerateVerhoeff("4817600")); Repo.DumpRepository(); Console.WriteLine("Repo Dumped."); Console.ReadKey(); }
public void ArtificalConceptIdGenerated() { //GenerateArtificalConceptId(); Random rnd = new Random(); ns = rnd.Next(1000000, 9999999); SCTIdGenerator IDgenerator = new SCTIdGenerator(ns); ArtificalConceptId = IDgenerator.GenerateConceptId(); Assert.AreNotEqual(ArtificalConceptId, 0); // COMMENT: BH - What should it equal? Anyway of being more specific than just 0, An assert = true is strict compared to a negative condition }