Beispiel #1
0
        public async Task UpdateValidThirdPartyDetails()
        {
            var request = new UpdateNativeDesktopThirdPartyViewModel
            {
                ThirdPartyComponents = "New Component",
                DeviceCapabilities   = "New Capability",
            };

            var result = await nativeDesktopThirdPartyController.UpdatedThirdParty(SolutionId, request) as NoContentResult;

            Expression <Func <UpdateSolutionNativeDesktopThirdPartyCommand, bool> > match = c =>
                                                                                            c.SolutionId == SolutionId &&
                                                                                            c.Data.ThirdPartyComponents == "New Component" &&
                                                                                            c.Data.DeviceCapabilities == "New Capability";

            Assert.NotNull(result);
            result.StatusCode.Should().Be(StatusCodes.Status204NoContent);

            mediatorMock.Verify(m => m.Send(It.Is(match), It.IsAny <CancellationToken>()));
        }
Beispiel #2
0
        public async Task UpdateValidThirdPartyDetails()
        {
            var request = new UpdateNativeDesktopThirdPartyViewModel
            {
                ThirdPartyComponents = "New Component",
                DeviceCapabilities   = "New Capability"
            };

            var result =
                (await _nativeDesktopThirdPartyController.UpdatedThirdParty(_solutionId, request)
                 .ConfigureAwait(false)) as NoContentResult;

            result.StatusCode.Should().Be((int)HttpStatusCode.NoContent);
            _mediatorMock.Verify(
                x => x.Send(
                    It.Is <UpdateSolutionNativeDesktopThirdPartyCommand>(c =>
                                                                         c.SolutionId == _solutionId && c.Data.ThirdPartyComponents == "New Component" &&
                                                                         c.Data.DeviceCapabilities == "New Capability"),
                    It.IsAny <CancellationToken>()), Times.Once);
        }