Ejemplo n.º 1
0
        public async Task WorkItemService_Reschedule_WorkItemRescheduled()
        {
            // Arrange
            var diHelper        = new DITestHelper();
            var serviceProvider = diHelper.BuildDefault();

            var context    = serviceProvider.GetRequiredService <TestDbContext>();
            var service    = serviceProvider.GetRequiredService <IWorkItemService>();
            var repository = serviceProvider.GetRequiredService <IWorkItemRepository>();

            var workItems = this.GetWorkItems();
            await context.WorkItems.AddRangeAsync(workItems);

            await context.SaveChangesAsync();


            var dueDate = SystemTime.Now().AddMinutes(1);
            var model   = new tomware.Microwf.Infrastructure.WorkItemDto
            {
                Id      = 1,
                DueDate = dueDate
            };

            // Act
            await service.Reschedule(model);

            // Assert
            var rescheduledItem = await repository.GetByIdAsync(1);

            Assert.NotNull(rescheduledItem);
            Assert.Equal(rescheduledItem.DueDate, dueDate);
        }
Ejemplo n.º 2
0
 public async Task Reschedule(WorkItemDto model)
 {
     await this.repository.Reschedule(model);
 }