示例#1
0
        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));
        }
示例#2
0
        [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;
 }
示例#4
0
        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));
        }