示例#1
0
 public async Task ThrowNotFoundException()
 {
     //Given
     UpdateSystemLookupCommandHandler handler = new UpdateSystemLookupCommandHandler(_Database);
     //Assert
     await Assert.ThrowsAsync <NotFoundException> (() => handler.Handle(new UpdateSystemLookupCommand {
         Lookups = new [] {
             new UpdatedSystemLookupModel()
             {
                 Id = 1, Value = "Production Updated", Type = "Cost Center"
             },
             new UpdatedSystemLookupModel()
             {
                 Id = 3, Value = "Production Updated", Type = "Cost Center"
             }
         }
     }, CancellationToken.None));
 }
示例#2
0
        public async Task UpdateSuccessfuly()
        {
            //Given
            UpdateSystemLookupCommandHandler handler = new UpdateSystemLookupCommandHandler(_Database);
            //When
            var result = await handler.Handle(new UpdateSystemLookupCommand {
                Lookups = new [] {
                    new UpdatedSystemLookupModel()
                    {
                        Id = 10, Value = "Production Updated", Type = "Cost Center"
                    },
                    new UpdatedSystemLookupModel()
                    {
                        Id = 11, Value = "Production Updated", Type = "Cost Center"
                    }
                }
            }, CancellationToken.None);

            //Then
            Assert.Equal(Unit.Value, result);
        }