public async Task removing_member_from_non_existing_capability_throws_exception() { var sut = new CapabilityApplicationServiceBuilder() .WithCapabilityRepository(new StubCapabilityRepository()) .Build(); var nonExistingCapabilityId = Guid.Empty; var dummyMemberId = "*****@*****.**"; await Assert.ThrowsAsync <CapabilityDoesNotExistException>(() => sut.LeaveCapability(nonExistingCapabilityId, dummyMemberId)); }
public async Task removing_non_existing_member_from_a_capability_throws_exception() { var capability = new CapabilityBuilder().Build(); var sut = new CapabilityApplicationServiceBuilder() .WithCapabilityRepository(new StubCapabilityRepository(capability)) .Build(); var nonExistingMemberEmail = "*****@*****.**"; await Assert.ThrowsAsync <NotMemberOfCapabilityException>(() => sut.LeaveCapability(capability.Id, nonExistingMemberEmail)); }
public async Task expected_member_is_removed_from_capability() { var stubMemberEmail = "*****@*****.**"; var capability = new CapabilityBuilder() .WithMembers(stubMemberEmail) .Build(); var sut = new CapabilityApplicationServiceBuilder() .WithCapabilityRepository(new StubCapabilityRepository(capability)) .Build(); await sut.LeaveCapability(capability.Id, stubMemberEmail); Assert.Empty(capability.Members); }