Example #1
0
    public void Trigger_Test()
    {
        int           btnID = 10;
        ButtonHandler btn   = new ButtonHandler(btnID);
        PlatHandler   plat  = new PlatHandler(1);

        plat.Initialize(new PlatHandlerTest.DummyOrange());
        plat.RegistButtonHandler(btn);
        int isTrigger = -1;

        btn.onTrigger += (a, b) => {
            isTrigger = (a as ButtonHandler).ID;
        };

        plat.SetEnable(true);
        btn.SetEnable(true);
        btn.Trigger();

        try
        {
            Assert.AreEqual(btnID, isTrigger);
        }
        catch (Exception e)
        {
            Debug.Log(plat.GetLog());
            Debug.Log("====================");
            Debug.Log(btn.GetLog());
            throw;
        }
    }