public void Setup() { _tellTheTime = Substitute.For <ITellTheTime>(); _build = Substitute.For <IBuild>(); _tellTheTime.Today().Returns(new DateTime(2017, 12, 04)); _tellTheTime.Now().Returns(new DateTime(2017, 12, 04)); }
private DateTime GetStartOfWeek() { var today = _tellTheTime.Today(); var offset = (int)today.DayOfWeek * -1; return(today.AddDays(offset)); }
public void Setup() { var builds = GetBuildDataFrom(new DateTime(2017, 01, 01), 300); _build = Substitute.For <IBuild>(); _tellTheTime = Substitute.For <ITellTheTime>(); _build.GetBuilds().Returns(builds); _build.GetSuccessfulBuildStepsContaining(Arg.Any <string>()).Returns( builds .Where(b => b.BuildTypeId.Contains("_01") && b.Status.Equals(BuildStatus.Success.ToString()) && b.State.Equals("Finished", StringComparison.InvariantCultureIgnoreCase)) .ToList()); _tellTheTime.Today().Returns(new DateTime(2017, 11, 27)); _tellTheTime.Now().Returns(new DateTime(2017, 11, 27)); _buildThroughput = new BuildThroughput(_build, _tellTheTime); }