Exemple #1
0
        public void SimpleRecord()
        {
            activitiesSummary.TimeLog = StubTimeLogWith(new Activity("first", DateTime.Now, sevenSec));

            activitiesSummary.Update();

            DataRow firstRow = activitiesSummary.Data.Rows[0];

            Assert.AreEqual("first", firstRow["Activity"]);
            Assert.AreEqual(sevenSec, firstRow["Spent"]);
        }
        public void GetRelatedTask()
        {
            ITimeLog timeLog = StubTimeLogWith(new Activity("first", DateTime.Now, sevenSec));
            linker = NewMock<ITaskActivityLinker>();
            Expect.AtLeastOnce.On(linker).Method("GetRelatedTaskName").With("first").Will(Return.Value("related task"));

            activitiesSummary = new ActivitiesSummary(timeLog,linker);
            activitiesSummary.Update();
            string task = activitiesSummary.Data.Rows[0]["Task"] as string;
            Assert.IsNotNull(task);
            Assert.AreEqual("related task", task);
        }
Exemple #3
0
        public void GetRelatedTask()
        {
            ITimeLog timeLog = StubTimeLogWith(new Activity("first", DateTime.Now, sevenSec));

            linker = NewMock <ITaskActivityLinker>();
            Expect.AtLeastOnce.On(linker).Method("GetRelatedTaskName").With("first").Will(Return.Value("related task"));

            activitiesSummary = new ActivitiesSummary(timeLog, linker);
            activitiesSummary.Update();
            string task = activitiesSummary.Data.Rows[0]["Task"] as string;

            Assert.IsNotNull(task);
            Assert.AreEqual("related task", task);
        }