예제 #1
0
        public void SimpleEnumToBoolConverter_ConvertBack_GivenMatchingEnumValue_ReturnEnum()
        {
            //------------Setup for test--------------------------
            var simpleEnumToBoolConvert = new SimpleEnumToBoolConverter();

            //------------Execute Test---------------------------
            var convert = (LogLevel)simpleEnumToBoolConvert.ConvertBack(true, typeof(bool), LogLevel.DEBUG, CultureInfo.InvariantCulture);

            //------------Assert Results-------------------------
            Assert.AreEqual(LogLevel.DEBUG, convert);
        }
예제 #2
0
        public void SimpleEnumToBoolConverter_ConvertBack_GivenNotMatchingEnumValue_ReturnBindingNothing()
        {
            //------------Setup for test--------------------------
            var simpleEnumToBoolConvert = new SimpleEnumToBoolConverter();

            //------------Execute Test---------------------------
            var convert = simpleEnumToBoolConvert.ConvertBack(false, typeof(bool), LogLevel.DEBUG, CultureInfo.InvariantCulture);

            //------------Assert Results-------------------------
            Assert.AreEqual(Binding.DoNothing, convert);
        }
예제 #3
0
        public void SimpleEnumToBoolConverter_Convert_GivenNotMatchingEnumValue_False()
        {
            //------------Setup for test--------------------------
            var simpleEnumToBoolConvert = new SimpleEnumToBoolConverter();

            //------------Execute Test---------------------------
            var convert = (bool)simpleEnumToBoolConvert.Convert(LogLevel.FATAL, typeof(bool), LogLevel.DEBUG, CultureInfo.InvariantCulture);

            //------------Assert Results-------------------------
            Assert.IsFalse(convert);
        }