Example #1
0
        public void Should_Be_OK_When_Delete()
        {
            var fakeContext = new FakeContext();

            fakeContext.FillWith <SystemModel>();

            using (ApplicationDbContext dbContext = new ApplicationDbContext(fakeContext.FakeOptions)) {
                var service    = new SystemService(dbContext);
                var controller = new SystemController(service);

                controller.Delete(1);
                var result = service.Get(s => s.Id == 1).FirstOrDefault();
                result.Should().BeNull();
            }
        }