Example #1
0
        private ModificationCommandBatch StartNewBatch(ParameterNameGenerator parameterNameGenerator, ModificationCommand modificationCommand)
        {
            parameterNameGenerator.Reset();
            var batch = _modificationCommandBatchFactory.Create();

            batch.AddCommand(modificationCommand);
            return(batch);
        }
Example #2
0
        public void TestReset()
        {
            //---------------Set up test pack-------------------
            ParameterNameGenerator gen = new ParameterNameGenerator("@");

            gen.GetNextParameterName();
            gen.GetNextParameterName();
            string paramName = gen.GetNextParameterName();

            //---------------Assert PreConditions---------------
            Assert.AreEqual("@Param2", paramName);

            //---------------Execute Test ----------------------
            gen.Reset();
            string paramNameAfterReset = gen.GetNextParameterName();

            //---------------Test Result -----------------------
            Assert.AreEqual("@Param0", paramNameAfterReset);
            //---------------Tear Down -------------------------
        }