Ejemplo n.º 1
0
        public void Execute_UtcToLocalWithCityName_Valid(object value, DateTime expected)
        {
            var function = new UtcToLocal(new LiteralScalarResolver <string>("Brussels"));
            var result   = function.Evaluate(value);

            Assert.That(result, Is.EqualTo(expected));
        }
Ejemplo n.º 2
0
        public void Execute_TextToDateTimeAndUtcToLocal_Valid(string value, string format, string timeZone, DateTime expected)
        {
            var textToDateTime = new TextToDateTime(new LiteralScalarResolver <string>(format));
            var utcToLocal     = new UtcToLocal(new LiteralScalarResolver <string>(timeZone));
            var result         = utcToLocal.Evaluate(textToDateTime.Evaluate(value));

            Assert.That(result, Is.EqualTo(expected));
            Assert.That(((DateTime)result).Kind, Is.EqualTo(DateTimeKind.Unspecified));
        }