Ejemplo n.º 1
0
        public void Then_culture_is_ensured_with_time_entry()
        {
            var ensureWasCalled = false;

              TimeEntryImplant.Ensure implant =
            culture
              => ensureWasCalled = true;

              var ts = new TimeServer();
              var chrono = new Chronograph(implant);

              chrono.IsDirty = false;
              chrono.SyncWith(ts);

              Assert.IsTrue(ensureWasCalled);
        }
Ejemplo n.º 2
0
        public LocalTime SyncWith(TimeServer ts)
        {
            var localTime = new LocalTime();

              if (IsDirty) {
            TimeEntry te = ts.GetTime();
            te.Apply(_culture);
            localTime = te.ToLocalTime();
              } else {
            TimeEntry te = new TimeEntry(localTime);
            te.EnsureImplant(_culture, _implant);
            localTime = te.ToLocalTime();
              }

              return localTime;
        }
Ejemplo n.º 3
0
        public void Then_culture_is_ensured_with_time_entry()
        {
            var ensureWasCalled = false;

            TimeEntryImplant.Ensure implant =
                culture
                => ensureWasCalled = true;

            var ts     = new TimeServer();
            var chrono = new Chronograph(implant);

            chrono.IsDirty = false;
            chrono.SyncWith(ts);

            Assert.IsTrue(ensureWasCalled);
        }
Ejemplo n.º 4
0
        public LocalTime SyncWith(TimeServer ts)
        {
            var localTime = new LocalTime();

            if (IsDirty)
            {
                TimeEntry te = ts.GetTime();
                te.Apply(_culture);
                localTime = te.ToLocalTime();
            }
            else
            {
                TimeEntry te = new TimeEntry(localTime);
                te.EnsureImplant(_culture, _implant);
                localTime = te.ToLocalTime();
            }

            return(localTime);
        }