本文整理汇总了C#中Project.StartTracking方法的典型用法代码示例。如果您正苦于以下问题:C# Project.StartTracking方法的具体用法?C# Project.StartTracking怎么用?C# Project.StartTracking使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Project
的用法示例。
在下文中一共展示了Project.StartTracking方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartTrackingSetsActive
public void StartTrackingSetsActive()
{
// ARRANGE
var project = new Project("Name");
// ACT
project.StartTracking(DateTime.UtcNow);
// ASSERT
Assert.True(project.IsActive);
}
示例2: StopTrackingSetsInactive
public void StopTrackingSetsInactive()
{
// ARRANGE
var project = new Project("A Project");
project.StartTracking(DateTime.UtcNow);
// ACT
project.StopTracking(DateTime.UtcNow);
// ASSERT
Assert.False(project.IsActive);
}
示例3: TickSegmentInProgressDurationBasedOnCurrentTime
public void TickSegmentInProgressDurationBasedOnCurrentTime()
{
// ARRANGE
var startingTime = DateTime.UtcNow;
var secondsToAdvance = 10;
var project = new Project("A Project");
Assert.Equal(0, project.TotalDurationSeconds); // TODO: Keep one assert per test. Create a seperated test.
// ACT
project.StartTracking(startingTime);
project.Tick(startingTime.AddSeconds(secondsToAdvance));
// ASSERT
Assert.Equal(secondsToAdvance, project.TotalDurationSeconds);
}
示例4: TickSegmentNotInProgressDurationBasedOnStoredTime
public void TickSegmentNotInProgressDurationBasedOnStoredTime()
{
// ARRANGE
var project = new Project("A Project");
var startingTime = DateTime.UtcNow;
var secondsToAdvance = 10;
var stopTime = startingTime.AddSeconds(secondsToAdvance);
project.StartTracking(startingTime);
project.StopTracking(stopTime);
// ACT
project.Tick(stopTime.AddMinutes(1));
// ASSERT
Assert.Equal(secondsToAdvance, project.TotalDurationSeconds);
}