Beispiel #1
0
        public void DispatchTest()
        {
            testSignal.AddCommand(typeof(CommandTest));
            testBinder.Get(typeof(CommandTest)).Returns(testCommand);

            testSignal.Dispatch();

            testBinder.Received().Get(typeof(CommandTest));
            testCommand.ReceivedWithAnyArgs().MapParameters(null);
            testCommand.Received().Execute();
        }
Beispiel #2
0
        public void MirandaGetCommandTest()
        {
            TestSignal testSignal = context.Get <TestSignal>();

            Assert.NotNull(testSignal);
            testSignal.Dispatch();
            Assert.Fail();
        }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        Application.RegisterLogCallback(HandleLog);
        Context context = Miranda.Init(new ParentContext(), new OtherContext());

        ExceptionSignal eS = context.Get <ExceptionSignal>();

        eS.AddOnce((x) => {
            Debug.Log(x[0]);
        });

        IObjectInject tA = context.Get <IObjectInject>();

        tA.PrintAFew();

        Debug.Log("+++++++++++++++++++++++++");

        IObjectInject tAA = context.Get <IObjectInject>();

        tAA.PrintAFew();

        Debug.Log("+++++++++++++++++++++++++");

        tAA.ChangeName("TESTINGOFSINGLETON");

        tA.PrintAFew();

        TestSignal testSignal = context.Get <TestSignal>();

        testSignal.AddOnce((x) => {
            foreach (object o in x)
            {
                Debug.Log(o);
            }
        });

        testSignal.Dispatch("A", "b", "C");

        TestSignal anotherSignal = context.Get <TestSignal>();

        anotherSignal.Dispatch();
    }
Beispiel #4
0
    public void PrintAFew()
    {
        Assert(test.Print().Equals("ANOTHER PRINT"), "Test wasn't equal to \"ANOTHER PRINT\"");
        Test2.PrintName();
        test3.PrintName();
        test4.Print();
        test5.Print();
        test6.Print();


        Debug.Log(myString);
        Debug.Log(myString2);
        Debug.Log(this.num);
        Debug.Log(FloatTest);
        Debug.Log(aString);

        test3.ChangeName("CHANGED");

        signal.Dispatch();
    }