public void SetUp() { _env = new ApplicationEnvironment(); string group = "Group"; ReportManager rm = _env.ReportManager; _unitUnderTest = rm.GetReportingSession(group); }
public void TearDown() { _unitUnderTest = null; }
public void TestConstructorReportingSession() { string group = "Group"; ReportManager rm = new ReportManager(_env); ReportingSession testReportingSession = new ReportingSession(group, rm); Assert.IsNotNull(testReportingSession, "Constructor of type, ReportingSession failed to create instance."); Assert.AreEqual(false, testReportingSession.IsReadOnly, "IsReadOnly is unexpected value."); Assert.AreEqual(group, testReportingSession.Group, "Group is unexpected value."); Assert.AreEqual(0, testReportingSession.Count, "Count is unexpected value."); }
/// <summary> /// Create a ReportingSession object /// </summary> /// <remarks> /// In this sample code the ReportingSession is instantiated and used for all calls. /// The life span of this object is limited to five miniutes on the application server. /// </remarks> private static void CreateReportingSession() { var baseServiceAddress = Settings.BaseServiceAddress; var userId = Settings.UserId; var password = Settings.Password; var config = new ReportingSessionConfiguration { UserID = userId, Password = password, BaseServiceAddress = baseServiceAddress, RequestTimeout = 30 }; _session = new ReportingSession(config); }
/// <summary> /// ReportingSessionEventArgs /// </summary> /// <param name="session">Report session object.</param> public ReportingSessionEventArgs(ReportingSession session) { m_session = session; }
/// <summary> /// Get the report session by usin the group name. /// </summary> /// <param name="group">the group stirng.</param> /// <returns>the report settion.</returns> public ReportingSession GetReportingSession(string group) { lock (this) { if (m_repList.ContainsKey(group)) { return this.m_repList[group]; // throw new InvalidOperationException(); } m_repList[group] = new ReportingSession(group, this); } Trace.WriteLine("ReportingSession acquired"); if (ReportingSessionStarted != null) ReportingSessionStarted(this, new ReportingSessionEventArgs(m_repList[group])); return m_repList[group]; }
public static void ShowResults(string title, ReportingSession session) { ShowHeader(title); Console.WriteLine(session.DataQuery); Console.WriteLine(); }