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); }
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())); }
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); }