コード例 #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"]);
        }
コード例 #2
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);
        }
コード例 #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);
        }