Example #1
0
        public void unregistering_receivers_should_work()
        {
            int excpetedReceiversCount = 0;

            MVVMMessagerService.RegisterReceiver(typeof(MVVMMessagerService), () => { });
            MVVMMessagerService.UnregisterReceiver(typeof(MVVMMessagerService));

            Assert.AreEqual(excpetedReceiversCount, MVVMMessagerService.GetReceiversNum(typeof(MVVMMessagerService)));
        }
Example #2
0
        public void registered_receivers_should_be_one()
        // cant register more than 1 receivers for one type
        {
            int exceptedValue = 1;

            MVVMMessagerService.RegisterReceiver(typeof(MVVMMessagerService), () => { });
            MVVMMessagerService.RegisterReceiver(typeof(MVVMMessagerService), () => { });
            MVVMMessagerService.RegisterReceiver(typeof(MVVMMessagerService), () => { });

            Assert.AreEqual(exceptedValue, MVVMMessagerService.GetReceiversNum(typeof(MVVMMessagerService)));
        }