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); }
public void NoDeletes() { var entity = GetTestEntity(); var input = GetTestReader(entity); var output = GetTestReader(entity); var deleter = new TestDeleter(entity, output.Data); var context = new PipelineContext(new TraceLogger(), new Process(), entity); var deleteHandler = new DefaultDeleteHandler(context, input, output, deleter); deleteHandler.Delete(); Assert.AreEqual(2, deleter.Data.Count); }
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"); }
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"); }
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"); }
public void DeleteAll() { var entity = GetTestEntity(); entity.ModifyIndexes(); Assert.AreEqual(0, entity.Errors().Length); 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(), entity); var deleteHandler = new DefaultDeleteHandler(context, input, output, deleter); deleteHandler.Delete(); Assert.AreEqual(0, deleter.Data.Count, "output should everthing too"); }