Пример #1
0
        public static void AssertEqual(this IList <Subscription> subscriptions, params Subscription[] other)
        {
            subscriptions = Collapsed(subscriptions).ToList();

            if (subscriptions.Count != other.Length)
            {
                if (subscriptions.Count < other.Length)
                {
                    FailEqual(subscriptions, other);
                }

                for (var i = 0; i < other.Length; ++i)
                {
                    Assert.AreEqual(subscriptions[i].Subscribe, other[i].Subscribe, Message(subscriptions, other));
                    var tail = subscriptions.Count - other.Length;
                    Assert.AreEqual(subscriptions[tail + i].Unsubscribe, other[i].Unsubscribe, Message(subscriptions, other));
                }
            }
            else
            {
                ReactiveAssert.AssertEqual(subscriptions, other);
            }
        }