Example #1
0
        public void GetTagDateTimeOffsetValueOrNullReturnsCorrectDateTimeOffsetValue()
        {
            var tags = new Dictionary<string, string>();

            string testKey = "testKey";
            string testValue = "2014-09-23T00:00:00.0000000-07:00";

            tags[testKey] = testValue;

            DateTimeOffset? tagValue = tags.GetTagDateTimeOffsetValueOrNull(testKey);

            DateTimeOffset expectedValue = new DateTimeOffset(new DateTime(2014, 9, 23), TimeSpan.FromHours(-7));

            Assert.Equal(expectedValue, tagValue);
        }
Example #2
0
        public void GetTagDateTimeOffsetValueOrNullReturnsNull()
        {
            var tags = new Dictionary<string, string>();

            DateTimeOffset? tagValue = tags.GetTagDateTimeOffsetValueOrNull("testKey");

            Assert.Null(tagValue);
        }