示例#1
0
        public async Task Handle_Success()
        {
            // Arrange
            var request = new GetEditRoles(DiverFactory.JohnDoeUserName, outputPort);

            // Act
            var result = await interactor.Handle(request, CancellationToken.None);

            // Assert
            result.IsSuccessful.Should().BeTrue();
            A.CallTo(() => outputPort.Output(A <GetEditRolesOutput> ._))
            .MustHaveHappenedOnceExactly();
        }
示例#2
0
        public async Task Handle_DiverNotFound_MustFailWithNotFound()
        {
            // Arrange
            var request = new GetEditRoles(DiverFactory.JaneDoeUserName, outputPort);

            // Act
            var result = await interactor.Handle(request, CancellationToken.None);

            // Assert
            result.IsSuccessful.Should().BeFalse();
            result.ResultCategory.Should().Be(ResultCategory.NotFound);
            A.CallTo(() => outputPort.Output(A <GetEditRolesOutput> ._))
            .MustNotHaveHappened();
        }