Example #1
0
        public void ShouldReturnNullStringForNullValue()
        {
            object converted = new NullValueConverter().Convert(null, null, null, null);

              Assert.IsInstanceOfType(converted, typeof(string));
              Assert.AreEqual<string>(NullValueConverter.NullString, (string)converted);
        }
Example #2
0
        public void ShouldConvertProvidedValue()
        {
            object converted = new NullValueConverter().Convert("test", null, null, null);

              Assert.IsInstanceOfType(converted, typeof(string));
              Assert.AreEqual<string>("test", (string)converted);
        }
Example #3
0
        public void ShouldConvertNullToParameterValue()
        {
            object converted = new NullValueConverter().Convert(null, null, "<null>", null);

              Assert.IsInstanceOfType(converted, typeof(string));
              Assert.AreEqual("<null>", converted);
        }
Example #4
0
 public void ShouldConvertBackNullString()
 {
     object converted = new NullValueConverter().ConvertBack(NullValueConverter.NullString, null, null, null);
       Assert.IsNull(converted);
 }
Example #5
0
        public void ShouldConvertBackEmptyString()
        {
            object converted = new NullValueConverter().ConvertBack(string.Empty, null, null, null);

              Assert.IsNull(converted);
        }