public void EmailSink() { string sinkName = "SampleEmailSink"; EmailSinkData sink = new EmailSinkData(); sink.Name = sinkName; SinkFromFactory(sink); }
public EmailMessage(EmailSinkData configurationData, LogEntry logEntry, ILogFormatter formatter) { this.configurationData = configurationData; this.logEntry = logEntry; this.formatter = formatter; }
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); }
/// <summary> /// Creates node with specified configuration data. /// </summary> /// <param name="emailSinkData">Configuration data.</param> public EmailSinkNode(EmailSinkData emailSinkData) : base(emailSinkData) { this.emailSinkData = emailSinkData; }
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; }
internal override EmailMessage CreateEmailMessage(EmailSinkData sinkParameters, LogEntry logEntry, ILogFormatter formatter) { return new MockEmailMessage(sinkParameters, logEntry, formatter); }
public MockEmailMessage(EmailSinkData sinkParameters, LogEntry logEntry, ILogFormatter formatter) : base(sinkParameters, logEntry, formatter) { }