Exemplo n.º 1
0
        public void GetDynamicValues_NowAfter10AM_CorrectValues(string culture)
        {
            var engine = new StringTemplateEngineTesting();

            Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(culture);
            var values = engine.GetDynamicValues(new DateTime(2014, 12, 03, 15, 5, 7), 1, "toto");

            Assert.That(values[0], Is.EqualTo("2014-12-03T15:05:07"));
            //Console.WriteLine(values[1]);
            Assert.That(DateTime.Parse(values[1]).TimeOfDay, Is.EqualTo(new TimeSpan(15, 5, 7)));
            //Console.WriteLine(values[2]);
            Assert.That(DateTime.Parse(values[2]), Is.EqualTo(new DateTime(2014, 12, 03)));
        }
Exemplo n.º 2
0
        public void GetDynamicValues_NowBefore10AM_CorrectValues(string culture)
        {
            var engine = new StringTemplateEngineTesting();

            Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(culture);
            var values = engine.GetDynamicValues(new DateTime(2014, 09, 26, 9, 16, 55), 1, "toto");

            Assert.That(values[0], Is.EqualTo("2014-09-26T09:16:55"));
            //Console.WriteLine(values[1]);
            Assert.That(DateTime.Parse(values[1]).TimeOfDay, Is.EqualTo(new TimeSpan(9, 16, 55)));
            //Console.WriteLine(values[2]);
            Assert.That(DateTime.Parse(values[2]), Is.EqualTo(new DateTime(2014, 09, 26)));
        }
Exemplo n.º 3
0
        public void GetDynamicValues_NowBefore10AM_CorrectValues(string culture)
        {
            var engine = new StringTemplateEngineTesting();
            Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(culture);
            var values = engine.GetDynamicValues(new DateTime(2014, 09, 26, 9, 16, 55), 1, "toto");

            Assert.That(values[0], Is.EqualTo("2014-09-26T09:16:55"));
            //Console.WriteLine(values[1]);
            Assert.That(DateTime.Parse(values[1]).TimeOfDay, Is.EqualTo(new TimeSpan(9, 16, 55)));
            //Console.WriteLine(values[2]);
            Assert.That(DateTime.Parse(values[2]), Is.EqualTo(new DateTime(2014, 09, 26)));
        }
Exemplo n.º 4
0
        public void GetDynamicValues_NowAfter10AM_CorrectValues(string culture)
        {
            var engine = new StringTemplateEngineTesting();
            Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(culture);
            var values = engine.GetDynamicValues(new DateTime(2014, 12, 03, 15, 5, 7), 1, "toto");

            Assert.That(values[0], Is.EqualTo("2014-12-03T15:05:07"));
            //Console.WriteLine(values[1]);
            Assert.That(DateTime.Parse(values[1]).TimeOfDay, Is.EqualTo(new TimeSpan(15, 5, 7)));
            //Console.WriteLine(values[2]);
            Assert.That(DateTime.Parse(values[2]), Is.EqualTo(new DateTime(2014, 12, 03)));
        }