public void CreateModifiersListWithUnspecifiedUser()
        {
            IIntegrationResult result = AddModification(IntegrationResultMother.CreateStillSuccessful());

            result.Modifications[0].UserName = null;
            Assert.AreEqual(ExpectedRecipients(always, success), new EmailMessage(result, publisher).Recipients);
        }
        public void CreateModifiersListForUnknownUser()
        {
            publisher.IndexedEmailUsers.Remove(modifier.Name);
            IIntegrationResult result = AddModification(IntegrationResultMother.CreateStillSuccessful());

            Assert.AreEqual(ExpectedRecipients(always, success), new EmailMessage(result, publisher).Recipients);
        }
        public void Publish()
        {
//            mockGateway.Expect("MailHost", "mock.gateway.org");
            mockGateway.Expect("Send", new IsAnything());
            IntegrationResult result = IntegrationResultMother.CreateStillSuccessful();

            publisher.Run(result);
            mockGateway.Verify();
        }
Beispiel #4
0
        public void Publish()
        {
//            mockGateway.Expect("MailHost", "mock.gateway.org");
            mockGateway.Setup(gateway => gateway.Send(It.IsAny <MailMessage>())).Verifiable();
            IntegrationResult result = IntegrationResultMother.CreateStillSuccessful();

            publisher.Run(result);
            mockGateway.Verify();
        }
        public void EmailSubject()
        {
            IntegrationResult ir = IntegrationResultMother.CreateStillSuccessful();
            EmailMessage      em = GetEmailMessage(ir, true);


            string subject = em.Subject;

            Assert.AreEqual("CCNET: Project#9 Build Successful: Build 0", subject);
        }
 public void ShouldNotSendMessageIfRecipientIsNotSpecifiedAndBuildIsSuccessful()
 {
     mockGateway.ExpectNoCall("Send", typeof(MailMessage));
     publisher = new EmailPublisher();
     publisher.EmailGateway = (EmailGateway)mockGateway.MockInstance;
     publisher.IndexedEmailUsers.Add("bar", new EmailUser("bar", "foo", "*****@*****.**"));
     publisher.IndexedEmailGroups.Add("foo", new EmailGroup("foo", new EmailGroup.NotificationType[] { EmailGroup.NotificationType.Change }));
     publisher.Run(IntegrationResultMother.CreateStillSuccessful());
     mockGateway.Verify();
 }
        public void UnitTestResultsShouldBeIncludedInEmailMessageWhenIncludesDetailsIsTrue()
        {
            IntegrationResult result = IntegrationResultMother.CreateStillSuccessful();

            System.IO.StreamReader reader = System.IO.File.OpenText("UnitTestResults.xml");
            string results = reader.ReadToEnd();

            reader.Close();

            result.AddTaskResult(results);
            publisher.IncludeDetails = true;

            string message = publisher.CreateMessage(result);

            Assert.IsTrue(message.IndexOf("Tests run") >= 0);
        }
        public void VerifyRecipientListForStillSuccessfulBuild()
        {
            IIntegrationResult result = AddModification(IntegrationResultMother.CreateStillSuccessful());

            Assert.AreEqual(ExpectedRecipients(always, modifier, success), new EmailMessage(result, publisher).Recipients);
        }