public async Task DeleteGoodsReceivedNoteFreeItemAsync_Returns_NoResult()
        {
            //Arrange
            var id = 2;

            _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.DeleteGoodsReceivedNoteFreeItemAsync(It.IsAny <GoodsReceivedNoteFreeItem>()));

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

            //Act
            await repository.DeleteGoodsReceivedNoteFreeItemAsync(id);

            // Assert
            _fixture.MockGoodsReceivedNoteFreeItemService.Verify(x => x.DeleteGoodsReceivedNoteFreeItemAsync(It.IsAny <GoodsReceivedNoteFreeItem>()), Times.Once);
        }
        public async Task DeleteGoodsReceivedNoteFreeItemAsync_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.DeleteGoodsReceivedNoteFreeItemAsync(It.IsAny <GoodsReceivedNoteFreeItem>()));

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

            //Act
            var exception = await Assert.ThrowsAsync <RestException>(() => repository.DeleteGoodsReceivedNoteFreeItemAsync(id));

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