Exemplo n.º 1
0
        public void GetHashCode_SameValue_SameCode()
        {
            // arrange
            var sub = new EventSubscription(typeof(Event), a => { }, _unsub.Object);

            // act

            // assert
            Assert.AreEqual(sub.GetHashCode(), sub.GetHashCode());
        }
Exemplo n.º 2
0
        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());
        }
Exemplo n.º 3
0
 public static void Subscribe(EventSubscription subscription)
 {
     _events.Subscribe(subscription);
     _eventSubs.Add(subscription);
     Resources.Put(subscription.GetHashCode().ToString(), subscription);
 }