Example #1
0
        public void ConvertingBackInvalidTypeReturnsUnsetValue()
        {
            // Arrange
            var conv = new UtcToLocal();

            // Act
            var v = conv.ConvertBack(string.Empty, null, null, null);

            // Assert
            Assert.AreEqual(DependencyProperty.UnsetValue, v);
        }
Example #2
0
        public void ConvertBackReturnsUtcTime()
        {
            // Arrange
            var conv = new UtcToLocal();

            var now = DateTime.Now;

            // Act
            var nowUtc = (DateTime)conv.ConvertBack(now, null, null, null);

            // Assert
            Assert.AreNotEqual(DateTimeKind.Utc, now.Kind);
            Assert.AreEqual(DateTimeKind.Utc, nowUtc.Kind);
        }