public async Task UpdateGoodsReceivedNoteFreeItemAsync_Throws_NotFoundException()
        {
            //Arrange
            var id = 201;

            _fixture.MockGoodsReceivedNoteFreeItemService.Setup(x => x.GetGoodsReceivedNoteFreeItemAsync(It.IsAny <Expression <Func <GoodsReceivedNoteFreeItem, bool> > >()))
            .Returns <Expression <Func <GoodsReceivedNoteFreeItem, bool> > >(expression => Task.FromResult(_fixture.GoodsReceivedNoteFreeItems.AsQueryable().FirstOrDefault(expression)));

            _fixture.MockGoodsReceivedNoteFreeItemService.Setup(x => x.UpdateGoodsReceivedNoteFreeItemAsync(It.IsAny <GoodsReceivedNoteFreeItem>()));

            var repository = new GoodsReceivedNoteFreeItemRepository(AutoMapperSingleton.Mapper, _fixture.MockGoodsReceivedNoteFreeItemService.Object);

            //Act
            var exception = await Assert.ThrowsAsync <RestException>(() => repository.UpdateGoodsReceivedNoteFreeItemAsync(id, _fixture.EditGoodsReceivedNoteFreeItemDto));

            //Assert
            exception.ErrorCode.Should().Be(HttpStatusCode.NotFound);
            exception.ErrorMessage.Should().Be("Goods received note free item not found.");
            exception.ErrorType.Should().Be(HttpStatusCode.NotFound.ToString());
        }
        public async Task UpdateGoodsReceivedNoteFreeItemAsync_Returns_Updated_GetGoodsReceivedNoteFreeItemDto()
        {
            //Arrange
            var id = 1;

            _fixture.MockGoodsReceivedNoteFreeItemService.Setup(x => x.GetGoodsReceivedNoteFreeItemAsync(It.IsAny <Expression <Func <GoodsReceivedNoteFreeItem, bool> > >()))
            .Returns <Expression <Func <GoodsReceivedNoteFreeItem, bool> > >(expression => Task.FromResult(_fixture.GoodsReceivedNoteFreeItems.AsQueryable().FirstOrDefault(expression)));

            _fixture.MockGoodsReceivedNoteFreeItemService.Setup(x => x.UpdateGoodsReceivedNoteFreeItemAsync(It.IsAny <GoodsReceivedNoteFreeItem>()));

            var repository = new GoodsReceivedNoteFreeItemRepository(AutoMapperSingleton.Mapper, _fixture.MockGoodsReceivedNoteFreeItemService.Object);

            //Act
            var result = await repository.UpdateGoodsReceivedNoteFreeItemAsync(id, _fixture.EditGoodsReceivedNoteFreeItemDto);

            //Assert
            result.Should().BeOfType(typeof(GetGoodsReceivedNoteFreeItemDto));
            result.Id.Should().Be(id);
            result.ItemTypeName.Should().Be("Grocery");
            result.ItemName.Should().Be("Chilli Powder");
            result.ItemUnitPrice.Should().Be(350);
            result.Quantity.Should().Be(2);
        }