public void Should_Delete_Layer() { var fakeContext = new FakeContext("DeleteLayer"); fakeContext.FillWith <Layer>(); using (var context = new MainContext(fakeContext.FakeOptions)) { var repository = new LayerRepository(context); var validator = new LayerValidator(); var service = new LayerService(repository, validator); var currentCount = context.Layer.Count(); Assert.NotEqual(0, currentCount); service.Delete(1); Assert.NotEqual(currentCount, context.Layer.Count()); repository.Dispose(); } }