示例#1
0
        public void EmailSink()
        {
            string sinkName = "SampleEmailSink";
            EmailSinkData sink = new EmailSinkData();
            sink.Name = sinkName;

            SinkFromFactory(sink);
        }
示例#2
0
 public EmailMessage(EmailSinkData configurationData, LogEntry logEntry, ILogFormatter formatter)
 {
     this.configurationData = configurationData;
     this.logEntry = logEntry;
     this.formatter = formatter;
 }
示例#3
0
 internal virtual EmailMessage CreateEmailMessage(EmailSinkData sinkParameters, LogEntry logEntry, ILogFormatter formatter)
 {
     return new EmailMessage(sinkParameters, logEntry, formatter);
 }
        public void EmailSinkDataTest()
        {
            string fromAddress = "testFromAddress";
            string name = "testName";
            string smtpServer = "testSmtpServer";
            string subjectLineEnder = "testSubjectLineEnder";
            string subjectLineStarter = "testSubjectLineStarter";
            string toAddress = "testToAddress";
            string typeName = typeof(EmailSink).AssemblyQualifiedName;

            EmailSinkData data = new EmailSinkData();
            data.FromAddress = fromAddress;
            data.Name = name;
            data.SmtpServer = smtpServer;
            data.SubjectLineEnder = subjectLineEnder;
            data.SubjectLineStarter = subjectLineStarter;
            data.ToAddress = toAddress;
            data.TypeName = typeName;

            EmailSinkNode node = new EmailSinkNode(data);
            GeneratedApplicationNode.Nodes.Add(node);
            EmailSinkData nodeData = (EmailSinkData) node.SinkData;

            Assert.AreEqual(fromAddress, nodeData.FromAddress);
            Assert.AreEqual(name, nodeData.Name);
            Assert.AreEqual(smtpServer, nodeData.SmtpServer);
            Assert.AreEqual(subjectLineEnder, nodeData.SubjectLineEnder);
            Assert.AreEqual(subjectLineStarter, nodeData.SubjectLineStarter);
            Assert.AreEqual(toAddress, nodeData.ToAddress);
            Assert.AreEqual(typeName, nodeData.TypeName);
        }
示例#5
0
 /// <summary>
 /// Creates node with specified configuration data.
 /// </summary>
 /// <param name="emailSinkData">Configuration data.</param>
 public EmailSinkNode(EmailSinkData emailSinkData)
     : base(emailSinkData)
 {
     this.emailSinkData = emailSinkData;
 }
示例#6
0
 public void Setup()
 {
     sinkParams = new EmailSinkData();
     sinkParams.ToAddress = "[email protected]";
     sinkParams.FromAddress = "*****@*****.**";
     sinkParams.SubjectLineStarter = "EntLib-Logging:";
     sinkParams.SubjectLineEnder = "has occurred";
     sinkParams.SmtpServer = "smtphost";
     this.sink = new EmailSink();
     this.sink.Initialize(new TestLogSinkConfigurationView(sinkParams));
     CommonUtil.ResetEventLogCounter();
     lastMailMessageSent = null;
 }
示例#7
0
 internal override EmailMessage CreateEmailMessage(EmailSinkData sinkParameters, LogEntry logEntry, ILogFormatter formatter)
 {
     return new MockEmailMessage(sinkParameters, logEntry, formatter);
 }
示例#8
0
 public MockEmailMessage(EmailSinkData sinkParameters, LogEntry logEntry, ILogFormatter formatter)
     : base(sinkParameters, logEntry, formatter)
 {
 }