예제 #1
0
        public MockProvider()
        {
            LastInstance         = this;
            NotificationService  = Substitute.For <INotificationService>();
            Dispatcher           = Substitute.For <IDispatcher>();
            Progress             = Substitute.For <IProgressIndicator>();
            NavigationService    = Substitute.For <INavigationService>();
            ConfigurationManager = Substitute.For <IConfigurationManager>();

            Dispatcher.IsUIThread.Returns(true);
        }
예제 #2
0
        public void ReceiveMessage_ReceivesCorrectMessageType()
        {
            var provider = new MockProvider();

            Dependency.Provider = provider;
            var messager = new Messager();

            provider.Messager = messager;

            var vm = new DummyVM();
            var o1 = new object();
            var o2 = (object)"test";

            messager.SendTo <DummyVM, object>(o1);
            messager.SendTo <DummyVM2, object>(o2);

            vm.ReceiveMessage();

            Assert.AreSame(o1, vm.Message);
        }