public void Should_Return_All_Layers() { var fakeContext = new FakeContext("GetAllLayers"); fakeContext.FillWith <Layer>(); using (var context = new MainContext(fakeContext.FakeOptions)) { var layerCountIndDb = context.Layer.Count(); var repository = new LayerRepository(context); var validator = new LayerValidator(); var service = new LayerService(repository, validator); Assert.Equal(layerCountIndDb, service.GetAll().Count()); repository.Dispose(); } }