Exemplo n.º 1
0
        public void TestModelLocal()
        {
            int RxAccountHandlerEvent = 0;
            int RxActionEvent1        = 0;
            int RxActionEvent2        = 0;
            int RxEventHandlerEvent1  = 0;
            int RxEventHandlerEvent2  = 0;

            TestModel1 locaModel = new TestModel1();

            locaModel.RxAccountHandlerEvent().Select(t => 10).Subscribe(t => RxAccountHandlerEvent = t);
            locaModel.RxActionEvent1().Select(t => 10).Subscribe(t => RxActionEvent1             = t);
            locaModel.RxActionEvent2().Select(t => 10).Subscribe(t => RxActionEvent2             = t);
            locaModel.RxEventHandlerEvent1().Select(t => 10).Subscribe(t => RxEventHandlerEvent1 = t);
            locaModel.RxEventHandlerEvent2().Select(t => 10).Subscribe(t => RxEventHandlerEvent2 = t);

            locaModel.FireAccountHandlerEvent();
            locaModel.FireActionEvent1();
            locaModel.FireActionEvent2();
            locaModel.FireEventHandlerEvent1();
            locaModel.FireEventHandlerEvent2();

            Assert.Equal(10, RxAccountHandlerEvent);
            Assert.Equal(10, RxActionEvent1);
            Assert.Equal(10, RxActionEvent2);
            Assert.Equal(10, RxEventHandlerEvent1);
            Assert.Equal(10, RxEventHandlerEvent2);
        }
Exemplo n.º 2
0
 TestModel1 TestModelMethod(out TestModel1 testModel)
 {
     testModel = new TestModel1();
     return(testModel);
 }