コード例 #1
0
ファイル: DeleteHandler.cs プロジェクト: mindis/Pipeline.Net
        public void NoDeletes() {
            var entity = GetTestEntity();
            entity.MinVersion = 1;  // to make entity.IsFirstRun() == false for testing purposes
            var input = GetTestReader(entity);
            var output = GetTestReader(entity);
            var deleter = new TestDeleter(entity, output.Data);
            var deleteHandler = new DefaultDeleteHandler(entity, input, output, deleter);

            deleteHandler.Delete();
            Assert.AreEqual(2, deleter.Data.Count);
        }
コード例 #2
0
        public void NoDeletes()
        {
            var entity = GetTestEntity();

            entity.MinVersion = 1;  // to make entity.IsFirstRun() == false for testing purposes
            var input         = GetTestReader(entity);
            var output        = GetTestReader(entity);
            var deleter       = new TestDeleter(entity, output.Data);
            var deleteHandler = new DefaultDeleteHandler(entity, input, output, deleter);

            deleteHandler.Delete();
            Assert.AreEqual(2, deleter.Data.Count);
        }
コード例 #3
0
        public void NoDeletes()
        {
            var entity = GetTestEntity();

            entity.IsFirstRun = false;
            var input         = GetTestReader(entity);
            var output        = GetTestReader(entity);
            var deleter       = new TestDeleter(entity, output.Data);
            var context       = new PipelineContext(new TraceLogger(), new Process().WithValidation(), entity);
            var deleteHandler = new DefaultDeleteHandler(context, input, output, deleter);

            deleteHandler.Delete();
            Assert.AreEqual(2, deleter.Data.Count);
        }
コード例 #4
0
ファイル: DeleteHandler.cs プロジェクト: mindis/Pipeline.Net
        public void DeleteAll() {
            var entity = GetTestEntity();
            entity.MinVersion = 1;  // to make entity.IsFirstRun() == false for testing purposes
            var input = GetTestReader(entity);
            var output = GetTestReader(entity);

            // remove one from input
            input.Data.Clear();

            var deleter = new TestDeleter(entity, output.Data);
            var deleteHandler = new DefaultDeleteHandler(entity, input, output, deleter);

            deleteHandler.Delete();
            Assert.AreEqual(0, deleter.Data.Count, "output should everthing too");
        }
コード例 #5
0
ファイル: DeleteHandler.cs プロジェクト: mindis/Pipeline.Net
        public void OneDelete() {
            var entity = GetTestEntity();
            entity.MinVersion = 1;  // to make entity.IsFirstRun() == false for testing purposes
            var input = GetTestReader(entity);
            var output = GetTestReader(entity);

            // remove one from input
            var last = input.Data.Last();
            input.Data.Remove(last);

            var deleter = new TestDeleter(entity, output.Data);
            var deleteHandler = new DefaultDeleteHandler(entity, input, output, deleter);

            deleteHandler.Delete();
            Assert.AreEqual(1, deleter.Data.Count, "output should loose one too");
        }
コード例 #6
0
        public void DeleteAll()
        {
            var entity = GetTestEntity();

            entity.MinVersion = 1;  // to make entity.IsFirstRun() == false for testing purposes
            var input  = GetTestReader(entity);
            var output = GetTestReader(entity);

            // remove one from input
            input.Data.Clear();

            var deleter       = new TestDeleter(entity, output.Data);
            var deleteHandler = new DefaultDeleteHandler(entity, input, output, deleter);

            deleteHandler.Delete();
            Assert.AreEqual(0, deleter.Data.Count, "output should everthing too");
        }
コード例 #7
0
        public void OneDelete()
        {
            var entity = GetTestEntity();

            entity.MinVersion = 1;  // to make entity.IsFirstRun() == false for testing purposes
            var input  = GetTestReader(entity);
            var output = GetTestReader(entity);

            // remove one from input
            var last = input.Data.Last();

            input.Data.Remove(last);

            var deleter       = new TestDeleter(entity, output.Data);
            var deleteHandler = new DefaultDeleteHandler(entity, input, output, deleter);

            deleteHandler.Delete();
            Assert.AreEqual(1, deleter.Data.Count, "output should loose one too");
        }
コード例 #8
0
        public void OneDelete()
        {
            var entity = GetTestEntity();

            entity.MinVersion = 1;  // to make entity.IsFirstRun() == false for testing purposes
            var input  = GetTestReader(entity);
            var output = GetTestReader(entity);

            // remove one from input
            var last = input.Data.Last();

            input.Data.Remove(last);

            var deleter       = new TestDeleter(entity, output.Data);
            var context       = new PipelineContext(new TraceLogger(), new Process().WithValidation(), entity);
            var deleteHandler = new DefaultDeleteHandler(context, input, output, deleter);

            deleteHandler.Delete();
            Assert.AreEqual(1, deleter.Data.Count, "output should loose one too");
        }
コード例 #9
0
        public void DeleteAll()
        {
            var entity = GetTestEntity();

            entity.ModifyIndexes();

            Assert.AreEqual(0, entity.Errors().Length);

            entity.IsFirstRun = false;
            var input  = GetTestReader(entity);
            var output = GetTestReader(entity);

            // remove one from input
            input.Data.Clear();

            var deleter       = new TestDeleter(entity, output.Data);
            var context       = new PipelineContext(new TraceLogger(), new Process().WithValidation(), entity);
            var deleteHandler = new DefaultDeleteHandler(context, input, output, deleter);

            deleteHandler.Delete();
            Assert.AreEqual(0, deleter.Data.Count, "output should everthing too");
        }