Ejemplo n.º 1
0
        public async Task ItemExistsAsync_ItemDosNotExist_Should_Return_False()
        {
            using (var context = await InMemoryDbContext.GetContext().SeedDabase(TestSeed.GetItemsForTesting()))
            {
                //arrange
                var repository = new ToDoItemRepository(context);

                //act
                var result = await repository.ItemExistsAsync(Guid.Empty);

                //assert
                result.Should().BeFalse();
            }
        }
Ejemplo n.º 2
0
        public async Task ItemExistsAsync_ItemExists_Should_Return_True()
        {
            using (var context = await InMemoryDbContext.GetContext().SeedDabase(TestSeed.GetItemsForTesting()))
            {
                //arrange
                var repository = new ToDoItemRepository(context);

                //act
                var item = await context.ToDoItems.FirstAsync();

                var result = await repository.ItemExistsAsync(item.Id);

                //assert
                result.Should().BeTrue();
            }
        }