private bool CheckEquality(IVariant currentValue) { FAssert.AreEqual(_expectedValue.GetType(), currentValue.GetType(), $"Expected value is {_expectedValue.GetType().Name} but current value is {currentValue.GetType()}"); if (currentValue == _expectedValue) { return(true); } return(currentValue.Equals(_expectedValue)); }
[CanBeNull] public static Type FindValueType([NotNull] this IVariant variant) { var type = variant.GetType(); return(type.GetInterface(typeof(IVariant <int>).Name)?.GenericTypeArguments[0]); }
public SerializableVariant(IVariant variant) { _typeRef = variant.GetType(); _name = variant.Name; }
private int CompareValue(IVariant currentValue) { FAssert.AreEqual(_expectedValue.GetType(), currentValue.GetType(), $"Expected value is {_expectedValue.GetType().Name} but current value is {currentValue.GetType()}"); return(currentValue.CompareTo(_expectedValue)); }