예제 #1
0
        public async Task Process_GiftBoxUpdateForNonexistentCartLine_ShouldReturnValidationErrorMessage()
        {
            _findEntityPipelineMock
            .Setup(p => p.Run(It.IsAny <FindEntityArgument>(), It.IsAny <CommercePipelineExecutionContextOptions>()))
            .Returns(Task.FromResult((CommerceEntity)CreateInputCart("WrongCartLine1")));

            var outputCart = await _command.Process(_commerceContextFake, TestCartId, TestCartLineId, true);

            var errorMessage = _commerceContextFake.GetMessage(m => m.Code == new KnownResultCodes().ValidationError);

            Assert.NotNull(errorMessage);
        }