Exemple #1
0
 public static InsertFeedstockCommandRequest New(FeedstockCommandDto feedstockCommandDto)
 {
     return(new InsertFeedstockCommandRequest
     {
         FeedstockCommandDto = feedstockCommandDto
     });
 }
Exemple #2
0
 public static UpdateFeedstockCommandResquest New(FeedstockCommandDto feedstockCommandDto, Guid feedstockId)
 {
     return(new UpdateFeedstockCommandResquest
     {
         FeedstockCommandDto = feedstockCommandDto,
         FeedstockId = FeedstockId.New(feedstockId)
     });
 }
Exemple #3
0
        public async Task Should_Insert_Feedstock()
        {
            var insertFeedstockCommandHandler = new InsertFeedstockCommandHandler(_feedstockRepository);
            var feedstockCommand = FeedstockCommandDto.New("blue", StatusEnum.Enable, Guid.NewGuid(), 3, Guid.NewGuid(), Guid.NewGuid());
            var request          = InsertFeedstockCommandRequest.New(feedstockCommand);

            await insertFeedstockCommandHandler.Handle(request, new CancellationToken());

            Assert.True(inserted);
        }
Exemple #4
0
        public async Task Should_Update_Feedstock()
        {
            var feedstockId = Guid.NewGuid();
            var updateFeedstockCommandHandler = new UpdateFeedstockCommandHandler(_feedstockRepository);
            var feedstockCommand = FeedstockCommandDto.New("blue", StatusEnum.Enable, Guid.NewGuid(), 2, Guid.NewGuid(), Guid.NewGuid());
            var request          = UpdateFeedstockCommandResquest.New(feedstockCommand, feedstockId);

            await updateFeedstockCommandHandler.Handle(request, new CancellationToken());

            Assert.True(updated);
            Assert.Equal(feedstockId, Guid.Parse(request.FeedstockId.Value.ToString()));
        }
Exemple #5
0
        public void Should_Create_FeedstockCommandDto()
        {
            var feedstockCommandDtoTest = FeedstockCommandDto.New(_feedstockName, _status, _measureId, _stock, _colorId, _tenantId);

            Assert.NotNull(feedstockCommandDtoTest);
            Assert.Equal(_stock, feedstockCommandDtoTest.Stock);
            Assert.Equal(_tenantId, feedstockCommandDtoTest.TenantId);
            Assert.Equal(_colorId, feedstockCommandDtoTest.ColorId);
            Assert.Equal(_measureId, feedstockCommandDtoTest.MeasureId);
            Assert.Equal(_status, feedstockCommandDtoTest.Status);
            Assert.Equal(_feedstockName, feedstockCommandDtoTest.Name);
        }
Exemple #6
0
 public static Entities.Feedstock Map(FeedstockCommandDto feedstockInsertDto)
 {
     return(Entities.Feedstock.New(feedstockInsertDto.Name, feedstockInsertDto.Status,
                                   MeasureId.New(feedstockInsertDto.MeasureId), feedstockInsertDto.Stock,
                                   ColorId.New(feedstockInsertDto.ColorId), TenantId.New(feedstockInsertDto.TenantId)));
 }