예제 #1
0
 public void Validation_LongName()
 {
     var campaign = new CampaignBuilder().WithName(GetCharacters(50)).Build();
     Assert.IsTrue(campaign.IsValid);
     campaign.Name = GetCharacters(51);
     AssertInvalidWithErrorMessages(campaign);
 }
예제 #2
0
        public void when_matches_set_then_the_correct_messages_are_created()
        {
            var matches = new List<MatchResult>
                              {
                                  new MatchResult(new BuyerBuilder().Build(), new ProductBuilder().InnerCityApartmentsNoAttributes),
                                  new MatchResult(new BuyerBuilder().WithFirstName("Bob").WithLastName("Hawk").WithId(2).Build(), new ProductBuilder().WaterfrontMansionsNoAttributes),
                              };
            var campaign = new CampaignBuilder().Build();
            campaign.Matches = matches;

            Assert.AreEqual(campaign.Messages.Count, 2);
            Assert.AreEqual(campaign.Messages[0].MessageItems.Count, 2);
            Assert.AreEqual(campaign.Messages[1].MessageItems.Count, 3);
            Assert.AreEqual(campaign.Messages[1].MessageItems[2].Product.Name, "1 Chart St");
        }
예제 #3
0
 public void Validation_NullSubject()
 {
     var campaign = new CampaignBuilder().WithSubject(null).Build();
     AssertInvalidWithErrorMessages(campaign);
 }
예제 #4
0
 public void Validation_EmptyStringSubject()
 {
     var campaign = new CampaignBuilder().WithSubject(String.Empty).Build();
     Assert.IsTrue(campaign.IsValid);
 }
예제 #5
0
 public void Validation_EmptyStringName()
 {
     var campaign = new CampaignBuilder().WithName(String.Empty).Build();
     AssertInvalidWithErrorMessages(campaign);
 }