Example #1
0
        public void SetDateTimeOffsetValueOrRemoveRemovesValue()
        {
            var tags = new Dictionary<string, string>();
            
            string testKey = "testKey";
            string testValue = "2014-09-23T00:00:00.0000000-07:00";

            tags[testKey] = testValue;

            tags.SetDateTimeOffsetValueOrRemove(testKey, null);

            Assert.False(tags.ContainsKey(testKey));
        }
Example #2
0
        public void SetDateTimeOffsetValueOrRemoveSetsCorrectDateTimeOffsetValue()
        {
            var tags = new Dictionary<string, string>();

            string testKey = "testKey";
            DateTimeOffset testValue = new DateTimeOffset(new DateTime(2014, 9, 23), TimeSpan.FromHours(-7));

            tags.SetDateTimeOffsetValueOrRemove(testKey, testValue);

            Assert.Equal("2014-09-23T00:00:00.0000000-07:00", tags[testKey]);
        }