public void GetHashCode_SameValue_SameCode() { // arrange var sub = new EventSubscription(typeof(Event), a => { }, _unsub.Object); // act // assert Assert.AreEqual(sub.GetHashCode(), sub.GetHashCode()); }
public void GetHashCode_DifferentValue_DifferentCode() { // arrange var sub1 = new EventSubscription(typeof(Event), a => { }, _unsub.Object); var sub2 = new EventSubscription(typeof(Event), a => { }, _unsub.Object); // act // assert Assert.AreNotEqual(sub1.GetHashCode(), sub2.GetHashCode()); }
public static void Subscribe(EventSubscription subscription) { _events.Subscribe(subscription); _eventSubs.Add(subscription); Resources.Put(subscription.GetHashCode().ToString(), subscription); }