public void NegationConverter_Convert_TargetTypeBool() {
     var converter = new BooleanNegationConverter();
     Assert.AreEqual(true, converter.Convert(null, typeof(bool), null, null));
     Assert.AreEqual(false, converter.Convert(true, typeof(bool), null, null));
     Assert.AreEqual(true, converter.Convert(false, typeof(bool), null, null));
     Assert.AreEqual(false, converter.Convert(DefaultBoolean.True, typeof(bool), null, null));
     Assert.AreEqual(true, converter.Convert(DefaultBoolean.False, typeof(bool), null, null));
     Assert.AreEqual(true, converter.Convert(DefaultBoolean.Default, typeof(bool), null, null));
     Assert.AreEqual(false, converter.Convert(new Nullable<bool>(true), typeof(bool), null, null));
     Assert.AreEqual(true, converter.Convert(new Nullable<bool>(false), typeof(bool), null, null));
     Assert.AreEqual(true, converter.Convert(new Nullable<bool>(), typeof(bool), null, null));
     Assert.AreEqual(true, converter.Convert("test", typeof(bool), null, null));
 }
 public void NegationConverter_ConvertBack_TargeTypeDefaultBoolean() {
     var converter = new BooleanNegationConverter();
     Assert.AreEqual(DefaultBoolean.Default, converter.ConvertBack(null, typeof(DefaultBoolean), null, null));
     Assert.AreEqual(DefaultBoolean.False, converter.ConvertBack(true, typeof(DefaultBoolean), null, null));
     Assert.AreEqual(DefaultBoolean.True, converter.ConvertBack(false, typeof(DefaultBoolean), null, null));
     Assert.AreEqual(DefaultBoolean.False, converter.ConvertBack(DefaultBoolean.True, typeof(DefaultBoolean), null, null));
     Assert.AreEqual(DefaultBoolean.True, converter.ConvertBack(DefaultBoolean.False, typeof(DefaultBoolean), null, null));
     Assert.AreEqual(DefaultBoolean.Default, converter.ConvertBack(DefaultBoolean.Default, typeof(DefaultBoolean), null, null));
     Assert.AreEqual(DefaultBoolean.False, converter.ConvertBack(new Nullable<bool>(true), typeof(DefaultBoolean), null, null));
     Assert.AreEqual(DefaultBoolean.True, converter.ConvertBack(new Nullable<bool>(false), typeof(DefaultBoolean), null, null));
     Assert.AreEqual(DefaultBoolean.Default, converter.ConvertBack(new Nullable<bool>(), typeof(DefaultBoolean), null, null));
     Assert.AreEqual(DefaultBoolean.Default, converter.ConvertBack("test", typeof(DefaultBoolean), null, null));
 }
 public void NegationConverter_ConvertBack_NoTargetType() {
     var converter = new BooleanNegationConverter();
     Assert.AreEqual(null, converter.ConvertBack(null, null, null, null));
     Assert.AreEqual(false, converter.ConvertBack(true, null, null, null));
     Assert.AreEqual(true, converter.ConvertBack(false, null, null, null));
     Assert.AreEqual(false, converter.ConvertBack(DefaultBoolean.True, null, null, null));
     Assert.AreEqual(true, converter.ConvertBack(DefaultBoolean.False, null, null, null));
     Assert.AreEqual(null, converter.ConvertBack(DefaultBoolean.Default, null, null, null));
     Assert.AreEqual(false, converter.ConvertBack(new Nullable<bool>(true), null, null, null));
     Assert.AreEqual(true, converter.ConvertBack(new Nullable<bool>(false), null, null, null));
     Assert.AreEqual(null, converter.ConvertBack(new Nullable<bool>(), null, null, null));
     Assert.AreEqual(null, converter.ConvertBack("test", null, null, null));
 }