public void GolfClubAggregate_CreateGolfClub_GolfClubCreated()
        {
            GolfClubAggregate aggregate = GolfClubAggregate.Create(GolfClubTestData.AggregateId);

            aggregate.CreateGolfClub(GolfClubTestData.Name,
                                     GolfClubTestData.AddressLine1,
                                     GolfClubTestData.AddressLine2,
                                     GolfClubTestData.Town,
                                     GolfClubTestData.Region,
                                     GolfClubTestData.PostalCode,
                                     GolfClubTestData.TelephoneNumber,
                                     GolfClubTestData.Website,
                                     GolfClubTestData.EmailAddress);

            aggregate.ShouldNotBeNull();
            aggregate.AggregateId.ShouldBe(GolfClubTestData.AggregateId);
            aggregate.Name.ShouldBe(GolfClubTestData.Name);
            aggregate.AddressLine1.ShouldBe(GolfClubTestData.AddressLine1);
            aggregate.AddressLine2.ShouldBe(GolfClubTestData.AddressLine2);
            aggregate.Town.ShouldBe(GolfClubTestData.Town);
            aggregate.Region.ShouldBe(GolfClubTestData.Region);
            aggregate.PostalCode.ShouldBe(GolfClubTestData.PostalCode);
            aggregate.TelephoneNumber.ShouldBe(GolfClubTestData.TelephoneNumber);
            aggregate.Website.ShouldBe(GolfClubTestData.Website);
            aggregate.EmailAddress.ShouldBe(GolfClubTestData.EmailAddress);
            aggregate.HasBeenCreated.ShouldBeTrue();
        }
        public void GolfClubAggregate_CanBeCreated_IsCreated()
        {
            GolfClubAggregate aggregate = GolfClubAggregate.Create(GolfClubTestData.AggregateId);

            aggregate.ShouldNotBeNull();
            aggregate.AggregateId.ShouldBe(GolfClubTestData.AggregateId);
        }
        public void GolfClubAggregate_CreateGolfClub_DuplicateCreateGolfClubCalled_ErrorThrown()
        {
            GolfClubAggregate aggregate = GolfClubAggregate.Create(GolfClubTestData.AggregateId);

            Should.NotThrow(() =>
            {
                aggregate.CreateGolfClub(GolfClubTestData.Name,
                                         GolfClubTestData.AddressLine1,
                                         GolfClubTestData.AddressLine2,
                                         GolfClubTestData.Town,
                                         GolfClubTestData.Region,
                                         GolfClubTestData.PostalCode,
                                         GolfClubTestData.TelephoneNumber,
                                         GolfClubTestData.Website,
                                         GolfClubTestData.EmailAddress);
            });

            Should.Throw <InvalidOperationException>(() =>
            {
                aggregate.CreateGolfClub(GolfClubTestData.Name,
                                         GolfClubTestData.AddressLine1,
                                         GolfClubTestData.AddressLine2,
                                         GolfClubTestData.Town,
                                         GolfClubTestData.Region,
                                         GolfClubTestData.PostalCode,
                                         GolfClubTestData.TelephoneNumber,
                                         GolfClubTestData.Website,
                                         GolfClubTestData.EmailAddress);
            });
        }
 public void GolfClubAggregate_CanBeCreated_EmptyAggregateId_ErrorThrown()
 {
     Should.Throw <ArgumentNullException>(() =>
     {
         GolfClubAggregate aggregate = GolfClubAggregate.Create(Guid.Empty);
     });
 }
        public void GolfClubAggregate_CreateGolfClub_InvalidData_ErrorThrown(String name,
                                                                             String addressLine1,
                                                                             String town,
                                                                             String region,
                                                                             String postalCode)
        {
            GolfClubAggregate aggregate = GolfClubAggregate.Create(GolfClubTestData.AggregateId);

            Should.Throw <ArgumentNullException>(() =>
            {
                aggregate.CreateGolfClub(name,
                                         addressLine1,
                                         GolfClubTestData.AddressLine2,
                                         town,
                                         region,
                                         postalCode,
                                         GolfClubTestData.TelephoneNumber,
                                         GolfClubTestData.Website,
                                         GolfClubTestData.EmailAddress);
            });
        }