public void GolfClubMembershipAggregate_RequestMembership_DuplicatePlayerMembershipRequest_RequestRejected() { GolfClubMembershipAggregate aggregate = GolfClubMembershipTestData.GetCreatedGolfClubMembershipAggregateWithMembershipRequested(); Should.Throw <InvalidOperationException>(() => { aggregate.RequestMembership(GolfClubMembershipTestData.PlayerId, GolfClubMembershipTestData.PlayerFullName, GolfClubMembershipTestData.PlayerDateOfBirth, GolfClubMembershipTestData.PlayerGender, GolfClubMembershipTestData.RequestDateAndTime); }); }
public void GolfClubMembershipAggregate_GetMembership_MembershipReturned() { GolfClubMembershipAggregate aggregate = GolfClubMembershipTestData.GetCreatedGolfClubMembershipAggregateWithMembershipRequested(); MembershipDataTransferObject membership = aggregate.GetMembership(GolfClubMembershipTestData.PlayerId, GolfClubMembershipTestData.PlayerDateOfBirth, GolfClubMembershipTestData.PlayerGender); membership.MembershipId.ShouldNotBe(Guid.Empty); membership.PlayerId.ShouldBe(GolfClubMembershipTestData.PlayerId); membership.PlayerFullName.ShouldBe(GolfClubMembershipTestData.PlayerFullName); membership.PlayerDateOfBirth.ShouldBe(GolfClubMembershipTestData.PlayerDateOfBirth); membership.PlayerGender.ShouldBe(GolfClubMembershipTestData.PlayerGender); membership.AcceptedDateAndTime.ShouldBe(GolfClubMembershipTestData.RequestDateAndTime); membership.RejectedDateAndTime.ShouldBe(DateTime.MinValue); membership.RejectionReason.ShouldBeNullOrEmpty(); membership.Status.ShouldBe(1); }