예제 #1
0
        public void UnshimedCurrentUtcTimeReturnsExpectedTime()
        {
            var wrapper = new TimeWrapper();
            var now     = wrapper.CurrentUtcTime;

            Assert.IsTrue(now - DateTime.UtcNow < new TimeSpan(0, 0, 2));
        }
    private void addCar(CarInfo car)
    {
        string carName = car.name;

        if (!timers.ContainsKey(carName))
        {
            GameObject row = Instantiate(lapTimeRowPrefab);
            row.transform.SetParent(lapTimeList.transform, false);
            timers[carName] = new TimeWrapper(row, car);
        }
    }
예제 #3
0
        public void ShimedCurrentUtcTimeReturnsExpectedTime()
        {
            var wrapper  = new TimeWrapper();
            var expected = new DateTime(2032, 1, 1);

            using (ShimsContext.Create())
            {
                System.Fakes.ShimDateTime.UtcNowGet = () => expected;
                var now = wrapper.CurrentUtcTime;
                Assert.AreEqual(expected, now);
            }
        }
예제 #4
0
 public static void Save(IValueSink sink, TimeWrapper value)
 {
     Value<Time>.Save(sink, value.Item);
 }
 private int compareTimes(TimeWrapper t1, TimeWrapper t2)
 {
     return(t1.Standing - t2.Standing);
 }
예제 #6
0
 public static void Save(IValueSink sink, TimeWrapper value)
 {
     Value <Time> .Save(sink, value.Item);
 }