Esempio n. 1
0
        public async Task DoesGenreIdExistShouldReturnFalseIfNotFound()
        {
            var options = new DbContextOptionsBuilder <AlexandriaDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;

            var db = new AlexandriaDbContext(options);
            await db.Genres.AddAsync(
                new Genre
            {
                Name        = "test",
                Description = "description",
            });

            await db.SaveChangesAsync();

            var genresService = new GenresService(db);

            var result = await genresService.DoesGenreIdExistAsync(3);

            Assert.False(result);
        }