I have the following converter, which returns DependencyProperty.UnsetValue
from its ConvertBack
method:
public class DictionaryValueConverter<T> : IValueConverter
{
...
public object ConvertBack(
object value,
Type targetType,
object parameter,
string language)
{
return DependencyProperty.UnsetValue;
}
}
When trying to assert the returned value in a unit test, none of the assertions succeeds:
Assert.Same() Failure: Values are not the same instance
Expected: IInspectable { ObjRef = ObjectReference`1 { ThisPtr = 1754526379632, Vftbl = WinRT.IInspectable+Vftbl }, ThisPtr = 1754526379632 }
Actual: IInspectable { ObjRef = ObjectReference`1 { ThisPtr = 1754526385520, Vftbl = WinRT.IInspectable+Vftbl }, ThisPtr = 1754526385520 }
Assert.Equal() Failure: Values differ
Expected: IInspectable { ObjRef = ObjectReference`1 { ThisPtr = 2602783527936, Vftbl = WinRT.IInspectable+Vftbl }, ThisPtr = 2602783527936 }
Actual: IInspectable { ObjRef = ObjectReference`1 { ThisPtr = 2602783529856, Vftbl = WinRT.IInspectable+Vftbl }, ThisPtr = 2602783529856 }
How can we test that the returned result should be DependencyProperty.UnsetValue
?
Tried several types of assertions but none of them works. I am expecting to be able to test that the resturned result is
DependencyProperty.UnsetValue
.