public void ContainsReturnsTrueOnlyForExactSameInstance() { MockSubscriptionCollection subscriptions = new MockSubscriptionCollection(); MockSubscription subscription1 = new MockSubscription("test", "testPub"); subscriptions.Add(subscription1); MockSubscription subscription2 = new MockSubscription("another", "anotherPub"); subscriptions.Add(subscription2); MockSubscription subscription3 = new MockSubscription("test", "testPub"); Assert.IsTrue(subscriptions.Contains(subscription1)); Assert.IsFalse(subscriptions.Contains(subscription3)); }
public void NewSubscriptionCollectHasNoElements() { MockSubscriptionCollection subscriptions = new MockSubscriptionCollection(); MockSubscription subscription = new MockSubscription("test", "testPub"); Assert.AreEqual(0, subscriptions.Count); Assert.AreEqual(-1, subscriptions.Find("test")); Assert.AreEqual(-1, subscriptions.Find(subscription)); Assert.IsFalse(subscriptions.ContainsKey("test")); Assert.IsFalse(subscriptions.Contains(subscription)); }