Ejemplo n.º 1
0
        public void set_the_clock_with_a_local_time()
        {
            var local = LocalTime.AtMachineTime("0800");

            var clock = new SettableClock();
            clock.LocalNow(local);

            clock.LocalTime().ShouldNotBeTheSameAs(local).ShouldEqual(local);

            clock.UtcNow().ShouldEqual(local.UtcTime);
        }
Ejemplo n.º 2
0
        public void set_the_clock()
        {
            var clock = new SettableClock();
            var localNow = DateTime.Today.AddHours(8);

            clock.LocalNow(localNow, TimeZoneInfo.Local);

            clock.LocalTime().Time.ShouldEqual(localNow);

            clock.UtcNow().ShouldEqual(localNow.ToUniversalTime(TimeZoneInfo.Local));
        }
        public void SetUp()
        {
            theTime = new SettableClock();
            theTime.LocalNow(LocalTime.AtMachineTime("1200")); // doesn't matter what, only needs to be constant

            theContainer = new Container(x => {
                x.IncludeRegistry<RavenDbRegistry>();
                x.For<RavenDbSettings>().Use(new RavenDbSettings {RunInMemory = true, DataDirectory = null, Url = null, ConnectionString = null});

                x.For<ISystemTime>().Use(theTime);
            });
        }