public async Task GetAllAsyncWorksCorrectly()
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString());
            var db         = new ApplicationDbContext(options.Options);
            var repository = new EfDeletableEntityRepository <Complaint>(db);
            var service    = new ComplaintsService(repository);

            AutoMapperConfig.RegisterMappings(typeof(TestComplaintModel).Assembly);

            await service.CreateAsync("1", "first complaint");

            await service.CreateAsync("1", "second complaint");

            var result = await service.GetAllAsync <TestComplaintModel>();

            Assert.NotNull(result);
        }
        public async Task CreateAsyncWorksCorrectly()
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString());
            var db         = new ApplicationDbContext(options.Options);
            var repository = new EfDeletableEntityRepository <Complaint>(db);
            var service    = new ComplaintsService(repository);

            var result = await service.CreateAsync("1", "first complaint");

            Assert.NotNull(result);
        }
        public async Task DeleteAsyncThrowsException()
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString());
            var db         = new ApplicationDbContext(options.Options);
            var repository = new EfDeletableEntityRepository <Complaint>(db);
            var service    = new ComplaintsService(repository);

            var result = await service.CreateAsync("1", "first complaint");

            await service.DeleteAsync(result.Id);

            await Assert.ThrowsAnyAsync <Exception>(async() => await service.DeleteAsync(result.Id));
        }