public void TestCreateWeekReport ()
 {
     RunAsync (async delegate {
         var view = new SummaryReportView ();
         view.Period = ZoomLevel.Week;
         await view.Load (0);
         Assert.AreEqual (false, view.IsLoading);
         Assert.AreEqual (false, view.IsError);
         Assert.AreEqual (true, view.ActivityCount == 7);
         Assert.AreEqual (true, view.Projects.Count > 0);
         Assert.AreEqual (true, view.CollapsedProjects.Count > 0);
     });
 }
Exemple #2
0
        public async void LoadData()
        {
            if ( IsClean) {
                try {
                    IsLoading = true;
                    dataSource = new SummaryReportView ();
                    dataSource.Period = ZoomLevel;

                    _delaying = true;
                    cts = new CancellationTokenSource ();
                    await Task.Delay (500, cts.Token);
                    _delaying = false;

                    await dataSource.Load (TimeSpaceIndex);

                    if ( !dataSource.IsLoading) {
                        barChart.ReportView = dataSource;
                        pieChart.ReportView = dataSource;
                    }
                    IsClean = IsError; // Declare ReportView as clean if an error occurs..

                } catch (Exception ex) {
                    IsClean = true;
                } finally {
                    IsLoading = false;
                    _delaying = false;
                    cts.Dispose ();
                }
            }
        }