public async Task Handle_IsAdmin_Success() { // Arrange var request = new GetMemberManagement(presenter); // Act var result = await interactor.Handle(request, CancellationToken.None); // Assert result.IsSuccessful.Should().BeTrue(); A.CallTo(() => presenter.Output(A <MemberManagementOutput> ._)) .MustHaveHappenedOnceExactly(); }
public async Task Handle_NotIsAdmin_DenyAccess() { // Arrange A.CallTo(() => currentUser.GetIsAdminAsync()) .ReturnsLazily(() => Task.FromResult(false)); var request = new GetMemberManagement(presenter); // Act var result = await interactor.Handle(request, CancellationToken.None); // Assert result.IsSuccessful.Should().BeFalse(); result.ResultCategory.Should().Be(ResultCategory.AccessDenied); A.CallTo(() => presenter.Output(A <MemberManagementOutput> ._)) .MustNotHaveHappened(); }