Ejemplo n.º 1
0
		private static void SetNumberGeneratorSeedZero(string numberType)
		{
			INumberGenerator numGen = new NumberGenerator(numberType);
			numGen.SetSequenceNumber(0);
		}
Ejemplo n.º 2
0
		public void TestDifferentTableNameGetSecondNumber_FromSeperateNumberGeneratorInstance_AfterUpdate()
		{
			//---------------Clean Up --------------------------
			BOSequenceNumber.LoadNumberGenClassDef("another_number_generator");
			NumberGenerator numGen = new NumberGenerator("tmp", "another_number_generator");
			numGen.SetSequenceNumber(0);
			//---------------Set up test pack-------------------
			//---------------Execute Test ----------------------
			numGen.NextNumber();
			numGen.Save();
			numGen = new NumberGenerator("tmp", "another_number_generator");
			long nextNum = numGen.NextNumber();
			//---------------Test Result -----------------------
			Assert.AreEqual(2, nextNum);

		}
Ejemplo n.º 3
0
		public void TestSetSequenceNumber()
		{
			//---------------Set up test pack-------------------
			BOSequenceNumber.LoadNumberGenClassDef();
			NumberGenerator numGen = new NumberGenerator("tmp");
			numGen.NextNumber();
			numGen.Save();
			Assert.GreaterOrEqual( numGen.NextNumber(),1);
			//---------------Execute Test ----------------------
			numGen.SetSequenceNumber(0);
			//---------------Test Result -----------------------
			numGen = new NumberGenerator("tmp");
			Assert.AreEqual(1, numGen.NextNumber());
			//---------------Tear Down -------------------------          
		}
Ejemplo n.º 4
0
		private static void CleanupNumberGenerator()
		{
			BOSequenceNumber.LoadNumberGenClassDef();
			INumberGenerator numGen = new NumberGenerator("tmp");
			numGen.SetSequenceNumber(0);
		}
Ejemplo n.º 5
0
		public static void CleanUpContactPersonNumberGenerator_ForInMemory()
		{
			ContactPersonWithNumberGenerator.LoadDefaultClassDef();
			BOSequenceNumber.LoadNumberGenClassDef();
			INumberGenerator numGen = new NumberGenerator("GeneratedNumber");
			numGen.SetSequenceNumber(0);
		}
Ejemplo n.º 6
0
		public void TestAcceptance_GenerateFirstNumber_SeedNonZero()
		{
			//---------------Set up test pack-------------------
			//Create an entry in the number generator table for entry type to seed with seed = 100.
			BOSequenceNumber.LoadNumberGenClassDef();
			INumberGenerator numGen = new NumberGenerator("tmp");
			const int seedNumber = 100;
			numGen.SetSequenceNumber(seedNumber);
			//Create an instance of the number for a specific type of number (e.g. Invoice number)
			numGen = new NumberGenerator("tmp");
			//---------------Execute Test ----------------------
			//get the next number for invoice number
			long nextNumber = numGen.NextNumber();
			//---------------Test Result -----------------------
			//test number should be 101.
			Assert.AreEqual(seedNumber + 1, nextNumber);
			//---------------Tear Down -------------------------          
		}