public void SetUp() { DataTable activitiesSummaryTable = new DataTable("ActivitiesSummary"); activitiesSummaryTable.Columns.Add("Task"); activitiesSummaryTable.Columns.Add("Spent", TimeSpan.Zero.GetType()); ITaskCollection taskCollection = NewMock<ITaskCollection>(); Stub.On(taskCollection).Method("IsWorking").With("Work").Will(Return.Value(true)); Stub.On(taskCollection).Method("IsWorking").With("Rest").Will(Return.Value(false)); tasksSummary = new TasksSummary(activitiesSummaryTable,taskCollection); }
public void SetSummaryPeriod(DateTime from, DateTime to) { activitiesSummary.TimeLogs = TimeLogsManager.GetTimeLogs(from, to); TasksSummary goodTasksSummary = tasksSummary as TasksSummary; if (goodTasksSummary != null) { goodTasksSummary.Calculate(); } }
public void SetUp() { DataTable activitiesSummaryTable = new DataTable("ActivitiesSummary"); activitiesSummaryTable.Columns.Add("Task"); activitiesSummaryTable.Columns.Add("Spent", TimeSpan.Zero.GetType()); ITaskCollection taskCollection = NewMock <ITaskCollection>(); Stub.On(taskCollection).Method("IsWorking").With("Work").Will(Return.Value(true)); Stub.On(taskCollection).Method("IsWorking").With("Rest").Will(Return.Value(false)); tasksSummary = new TasksSummary(activitiesSummaryTable, taskCollection); }