mirror of
https://github.com/RPCS3/discord-bot.git
synced 2026-01-31 01:25:22 +01:00
22 lines
682 B
C#
22 lines
682 B
C#
using System;
|
|
using CompatBot.Utils;
|
|
using NUnit.Framework;
|
|
|
|
namespace Tests
|
|
{
|
|
[TestFixture]
|
|
public class TimeParserTests
|
|
{
|
|
[TestCase("2019-8-19 6:00 PT", "2019-08-19T13:00Z")]
|
|
[TestCase("2019-8-19 17:00 bst", "2019-08-19T16:00Z")]
|
|
[TestCase("2019-9-1 22:00 jst", "2019-09-01T13:00Z")]
|
|
public void TimeZoneConverterTest(string input, string utcInput)
|
|
{
|
|
var utc = DateTime.Parse(utcInput).Normalize();
|
|
Assert.That(TimeParser.TryParse(input, out var result), Is.True);
|
|
Assert.That(result, Is.EqualTo(utc));
|
|
Assert.That(result.Kind, Is.EqualTo(DateTimeKind.Utc));
|
|
}
|
|
}
|
|
}
|