Exemple #1
0
        public void NotificationChannelWithNoUri_OpenChannel_Calls_Open()
        {
            var chFactory = new TestHttpNotificationChannelFactory();
            var target = new ChannelManager("TestChannel", null, true, true, chFactory);

            target.OpenChannelAsync();

            Assert.IsTrue(chFactory.Mock.OpenCalled);
        }
Exemple #2
0
        public void NotificationChannelWithUri_OpenChannel_DoesNotCall_Open()
        {
            var chFactory = new TestHttpNotificationChannelFactory();
            chFactory.Mock.ChannelUri = new Uri("http://test.com");

            var target = new ChannelManager("TestChannel", null, true, true, chFactory);

            target.OpenChannelAsync();

            Assert.IsFalse(chFactory.Mock.OpenCalled);
        }
Exemple #3
0
        public void NotTileBound_ChannelUriEventTriggered_Calls_BindTile()
        {
            var chFactory = new TestHttpNotificationChannelFactory();
            chFactory.Mock.IsShellTileBound = false;

            var target = new ChannelManager("TestChannel", null, true, true, chFactory);
            target.OpenChannelAsync();

            chFactory.Mock.InvokeChannelUriUpdated(null);

            Assert.IsTrue(chFactory.Mock.BindToShellTileCalled);
        }
Exemple #4
0
 public void Constructor_UriListNull_DoesNotFail()
 {
     try
     {
         var chFactory = new TestHttpNotificationChannelFactory();
         var target = new ChannelManager("TestChannel", null, true, true, chFactory);
     }
     catch (Exception)
     {
         Assert.Fail("Should not throw exception");
     }
 }
Exemple #5
0
        public void ChannelUriUpdated_Invokes_OpenChannelCompleted_Event()
        {
            var testUri = new Uri("http://test.com");

            var chFactory = new TestHttpNotificationChannelFactory();

            var target = new ChannelManager("TestChannel", null, true, true, chFactory);

            target.OpenChannelCompleted += (sender, args) =>
                                                   {
                                                       Assert.IsTrue(args.NotificationUri == testUri);
                                                       EnqueueTestComplete();
                                                   };
            target.OpenChannelAsync();

            chFactory.Mock.ChannelUri = testUri;
            chFactory.Mock.InvokeChannelUriUpdated(null);
        }
Exemple #6
0
        public void ToastBound_ChannelUriEventTriggered_DoesNotCall_BindToast()
        {
            var chFactory = new TestHttpNotificationChannelFactory();
            chFactory.Mock.IsShellToastBound = true;

            var target = new ChannelManager("TestChannel",  null, true, true, chFactory);
            target.OpenChannelAsync();

            chFactory.Mock.InvokeChannelUriUpdated(null);

            Assert.IsFalse(chFactory.Mock.BindToShellToastCalled);
        }