Beispiel #1
0
        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));
        }
Beispiel #2
0
        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));
        }
Beispiel #3
0
        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);
        }