Esempio n. 1
0
        public void info_by_message_puts_a_time_stamp_on_it_2()
        {
            var l1 = new RecordingLogListener {
                IsInfoEnabled = true
            };
            var l2 = new RecordingLogListener {
                IsInfoEnabled = false, IsDebugEnabled = true
            };
            var l3 = new RecordingLogListener {
                IsInfoEnabled = true
            };

            l1.ListensForTypes[typeof(StringMessage)] = true;
            l2.ListensForTypes[typeof(StringMessage)] = true;
            l3.ListensForTypes[typeof(StringMessage)] = true;

            var systemTime = SystemTime.AtLocalTime(DateTime.Today.AddHours(8));
            var logger     = new Logger(new ILogListener[] { l1, l2, l3 }, new ILogModifier[] { new LogRecordModifier(systemTime) });

            var message = new StringMessage("something");

            logger.InfoMessage(message);

            message.Time.ShouldEqual(systemTime.UtcNow());
        }
        public void writes_expires_for_24_hours_by_default()
        {
            var systemTime = SystemTime.AtLocalTime("0800".ToTime());

            var headers = new AssetCacheHeaders(systemTime);

            var header = headers.HeadersFor(null).Single(x => x.Name == "Expires");

            header.Value.ShouldEqual(systemTime.UtcNow().AddDays(1).ToString("R"));
        }
        public void set_the_max_age_to_a_longer_time_frame()
        {
            var systemTime = SystemTime.AtLocalTime("0800".ToTime());

            var headers = new AssetCacheHeaders(systemTime);

            headers.MaxAgeInSeconds = 3 * 24 * 60 * 60;

            var header = headers.HeadersFor(null).Single(x => x.Name == "Expires");

            header.Value.ShouldEqual(systemTime.UtcNow().AddDays(3).ToString("R"));
        }
Esempio n. 4
0
 public void SetUp()
 {
     systemTime   = SystemTime.AtLocalTime("0800".ToTime());
     theCondition = new ConditionTimeFrame(systemTime);
 }
        public void stub_by_using_at_local_time_by_time()
        {
            var systemTime = SystemTime.AtLocalTime("0700".ToTime());

            systemTime.LocalTime().ShouldEqual(LocalTime.AtMachineTime("0700"));
        }