//Generate a random RelationshipId, that can be used for the remaining tests
        public void GenerateArtificalRelationshipId()
        {
            Random rnd = new Random();

            ns = rnd.Next(1000000, 9999999);
            SCTIdGenerator IDgenerator = new SCTIdGenerator(ns);

            ArtificalRelationshipId = IDgenerator.GenerateRelationshipId();
        }
예제 #2
0
        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();
        }