Esempio n. 1
0
        public void SetUp()
        {
            _env = new ApplicationEnvironment();

            string group = "Group";
            ReportManager rm = _env.ReportManager;
            _unitUnderTest = rm.GetReportingSession(group);
        }
Esempio n. 2
0
 public void TearDown()
 {
     _unitUnderTest = null;
 }
Esempio n. 3
0
 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.");
 }
Esempio n. 4
0
        /// <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;
 }
Esempio n. 6
0
 /// <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];
 }
Esempio n. 7
0
 public static void ShowResults(string title, ReportingSession session)
 {
     ShowHeader(title);
     Console.WriteLine(session.DataQuery);
     Console.WriteLine();
 }