Esempio n. 1
0
        public async Task MilestoneRepository_DeleteAsync_DeletesEntity()
        {
            var guidId         = Guid.Parse("9245950B-0F82-4B9E-9AF7-DEC9ACF171FA");
            var entityToDelete = MilestonesDbSet.Get().First(x => x.Id == guidId);
            var expectedCount  = MilestonesDbSet.Get().ToList().Count - 1;

            await using var context = new TimeTrackingDbContext(_dbOptions);
            var milestoneRepository = new MilestoneRepository(context);

            await milestoneRepository.DeleteAsync(entityToDelete);

            context.Milestones.Should().HaveCount(expectedCount);
        }