public void TheDefaultAttachmentContentDispositionCanBeChanged() { XmlReportFormatter formatter = new XmlReportFormatter(); formatter.DefaultAttachmentContentDisposition = AttachmentContentDisposition.Inline; Assert.AreEqual(AttachmentContentDisposition.Inline, formatter.DefaultAttachmentContentDisposition); }
public static IEnumerable <IEnumerable <object> > GetFormatterTestCaseGenerator() { IReportFormatter jsonFormatter = new JsonReportFormatter(); IReportFormatter xmlFormatter = new XmlReportFormatter(); yield return(new object[] { new Dictionary <string, IReportFormatter> { { "json", jsonFormatter } }, "json", jsonFormatter }); yield return(new object[] { new Dictionary <string, IReportFormatter> { { "json", jsonFormatter }, { "xml", xmlFormatter } }, "json", jsonFormatter }); yield return(new object[] { new Dictionary <string, IReportFormatter> { { "json", jsonFormatter }, { "xml", xmlFormatter } }, "xml", xmlFormatter }); }
public void FormatWritesTheReportWithTheDefaultAttachmentContentDispositionIfNoneSpecified() { IProgressMonitor progressMonitor = Mocks.Stub <IProgressMonitor>(); IReportWriter writer = Mocks.StrictMock <IReportWriter>(); using (Mocks.Record()) { writer.SaveReport(AttachmentContentDisposition.Absent, progressMonitor); } using (Mocks.Playback()) { XmlReportFormatter formatter = new XmlReportFormatter(); var reportFormatterOptions = new ReportFormatterOptions(); formatter.Format(writer, reportFormatterOptions, progressMonitor); } }
public void FormatWritesTheReportWithTheSpecifiedAttachmentContentDisposition() { IProgressMonitor progressMonitor = Mocks.Stub <IProgressMonitor>(); IReportWriter writer = Mocks.StrictMock <IReportWriter>(); using (Mocks.Record()) { writer.SaveReport(AttachmentContentDisposition.Link, progressMonitor); } using (Mocks.Playback()) { XmlReportFormatter formatter = new XmlReportFormatter(); ReportFormatterOptions options = new ReportFormatterOptions(); options.AddProperty(XmlReportFormatter.AttachmentContentDispositionOption, AttachmentContentDisposition.Link.ToString()); formatter.Format(writer, options, progressMonitor); } }
public void TheDefaultAttachmentContentDispositionIsAbsent() { XmlReportFormatter formatter = new XmlReportFormatter(); Assert.AreEqual(AttachmentContentDisposition.Absent, formatter.DefaultAttachmentContentDisposition); }