Beispiel #1
0
        public void AssertDeserialize <T>(string json, T expected)
            where T : IComparable <T>
        {
            var cmp = new DelegatedComparer <T>((l, r) => l.CompareTo(r));

            AssertDeserialize(json, expected, cmp);
        }
Beispiel #2
0
        public FilterKeyCollection(T rpAllKey, Func <T, T, int> rpComparer)
        {
            r_AllKey = rpAllKey;

            r_Comparer = new DelegatedComparer <T>(rpComparer);

            r_Keys.Add(r_AllKey);
        }
Beispiel #3
0
        public void AssertDeserializeNullableSingle <T, TValue>(string json, T expected)
            where T : ISingleNullableValueGraph <TValue>
            where TValue : struct, IComparable <TValue>
        {
            var cmp = new DelegatedComparer <T>((l, r) => {
                if (l?.Value == null && r?.Value == null)
                {
                    return(0);
                }
                if (l?.Value == null)
                {
                    return(-1);
                }
                if (r?.Value == null)
                {
                    return(1);
                }
                return(l.Value.Value.CompareTo(r.Value.Value));
            });

            AssertDeserialize(json, expected, cmp);
        }
Beispiel #4
0
        public void AssertDeserialize <T>(string json, T expected, CompareHandler <T> comparer)
        {
            var cmp = new DelegatedComparer <T>(comparer);

            AssertDeserialize(json, expected, cmp);
        }