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

            // Act
            var type      = conv.Convert(123, null, string.Empty, null);
            var enumValue = conv.Convert((TestEnum)2, null, string.Empty, null);

            // Assert
            Assert.AreEqual(DependencyProperty.UnsetValue, type);
            Assert.AreEqual(DependencyProperty.UnsetValue, enumValue);
        }
Beispiel #2
0
        public void NotMatchedEnumValueReturnsFalse()
        {
            // Arrange
            var conv = new EnumToBool();

            // Act
            var value = (bool)conv.Convert(TestEnum.Last, null, "First", null);

            // Assert
            Assert.IsFalse(value);
        }
Beispiel #3
0
        public void ConvertWithInvalidParameterReturnsUnsetValue()
        {
            // Arrange
            var conv = new EnumToBool();

            // Act
            var value = conv.Convert(null, null, 123, null);

            // Assert
            Assert.AreEqual(DependencyProperty.UnsetValue, value);
        }