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

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

            // Assert
            Assert.AreEqual(DependencyProperty.UnsetValue, v);
        }
Beispiel #2
0
        public void ConvertedValueIsInLocalTime()
        {
            // Arrange
            var conv   = new UtcToLocal();
            var nowUtc = DateTime.UtcNow;

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

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