Пример #1
0
 private void DeleteWorkItem(List <int> idsList)
 {
     try
     {
         _repWI.DeleteWorkItem(idsList, 0);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #2
0
        public void DeleteWorkItem_OnValidRequest_DeletesWorkItem()
        {
            // ARRANGE
            DbContextOptions <TestDatabaseContext> options = new DbContextOptionsBuilder <TestDatabaseContext>()
                                                             .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString())
                                                             .Options;
            IDatabaseContext   dbContext  = new TestDatabaseContext(options);
            WorkItemRepository repository = new WorkItemRepository(dbContext);

            dbContext.WorkItems.Add(new WorkItem()
            {
                ID = 1
            });

            dbContext.SaveChanges();

            // ACT
            repository.DeleteWorkItem(1);

            // ASSERT
            dbContext.WorkItems.Any(wi => wi.ID == 1).Should().BeFalse();
        }