コード例 #1
0
ファイル: TextTest.cs プロジェクト: ywscr/NBi
        public void Execute_TextToDateTimeWithCulture_Valid(string value, string format, string culture, DateTime expected)
        {
            var function = new TextToDateTime(new LiteralScalarResolver <string>(format), new LiteralScalarResolver <string>(culture));
            var result   = function.Evaluate(value);

            Assert.That(result, Is.EqualTo(expected));
        }
コード例 #2
0
ファイル: TextTest.cs プロジェクト: ywscr/NBi
        public void Execute_TextToDateTime_Valid(string value, string format, DateTime expected)
        {
            var function = new TextToDateTime(new LiteralScalarResolver <string>(format));
            var result   = function.Evaluate(value);

            Assert.That(result, Is.EqualTo(expected));
            Assert.That(((DateTime)result).Kind, Is.EqualTo(DateTimeKind.Unspecified));
        }
コード例 #3
0
ファイル: TextTest.cs プロジェクト: ywscr/NBi
        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));
        }