public void Desktop_FetchTest()
#endif
        {
            var       latch       = new ManualResetEvent(false);
            var       tester      = new SDKTest("123");
            Exception encountered = null;

            tester.GoFetch(new SDKTest.FetchedDelegate((x, r) =>
            {
                try
                {
                    Assert.Null(x);
                    Assert.NotNull(r);
                    Assert.NotNull(r["args"]);
                    Assert.IsAssignableFrom(typeof(IDictionary <String, Object>), r["args"]);
                    Assert.Equal(((IDictionary <String, Object>)r["args"])["foo"], "bar");
                }
                catch (Exception assertExc)
                {
                    encountered = assertExc;
                }
                finally
                {
                    latch.Set();
                }
            }));
            Assert.True(latch.WaitOne(30000));
            if (encountered != null)
            {
                throw encountered;
            }
        }
        public void Desktop_EventTest()
#endif
        {
            var tester       = new SDKTest("123");
            var latch        = new ManualResetEvent(false);
            var calledOnce   = false;
            var fakeDelegate = new SDKTest.FakeEventDelegate((sender, item) =>
            {
                Assert.False(calledOnce);
                calledOnce = true;
                Assert.NotNull(item);
                Assert.Equal(1, item.Test);
                latch.Set();
            });

            tester.FakeEvent += fakeDelegate;
            tester.TriggerFakeAfterTimeout();
            Assert.True(latch.WaitOne(1000));
            latch.Reset();

            tester.FakeEvent -= fakeDelegate;
            tester.TriggerFakeAfterTimeout();
#if WINDOWS_PHONE_APP || WINDOWS_APP
            Task.Delay(TimeSpan.FromSeconds(1)).Wait();
#else
            Thread.Sleep(1000);
#endif
        }
Example #3
0
    public void StartMovie()
    {
        PanelMovie.SetActive(false);
        SDKTest.SetTitleMovieObj(this);



        if (SDKTest.m_status == 1)
        {
            if (VAMPUnitySDK.show() == false)
            {
                SDKTest.m_status = 0;
            }
            else
            {
                AudioSource ad = GetComponent <AudioSource>();
                ad.mute = true;
            }
        }

        if (SDKTest.m_status == 0)
        {
            VAMPUnitySDK.load();

            PanelOK.SetActive(false);
            Panelerr.SetActive(true);
        }
    }
        public void Desktop_CallbackTest()
#endif
        {
            String testing = "Testing123";
            var    tester  = new SDKTest(testing);

            var latch = new ManualResetEvent(false);

            tester.Echo(testing, (e, a) =>
            {
                Assert.Null(e);
                Assert.Equal(testing, a);
                latch.Set();
            });
            Assert.True(latch.WaitOne(1000));
            latch.Reset();

            tester.EchoWithSetTimeout(testing, (e, a) =>
            {
                Assert.Null(e);
                Assert.Equal(testing, a);
                latch.Set();
            });
            Assert.True(latch.WaitOne(1000));
            latch.Reset();
        }
Example #5
0
    public void ActionMovie()
    {
        Moviepanel.SetActive(false);
        SDKTest.SetMenuObj(this);



        if (SDKTest.m_status == 1)
        {
            if (VAMPUnitySDK.show() == false)
            {
                SDKTest.m_status = 0;
            }
            else
            {
                flowchart.ExecuteBlock("mute");
            }
        }

        if (SDKTest.m_status == 0)
        {
            VAMPUnitySDK.load();

            DisplayMessage("動画の再生に失敗しました。\n\n" + "※インターネット接続を確認し、しばらくしてから再生してください。\n");
            Messagepanel.SetActive(true);
            flowchart.ExecuteBlock("nonmute");
        }
    }
        public void Desktop_StaticFunctionCallTest()
#endif
        {
            var d = SDKTest.StaticMethod();

            Assert.NotNull(d);
            Assert.IsAssignableFrom(typeof(SDKTest), d);
        }
        public void Desktop_DictionaryTest()
#endif
        {
            var d    = new SDKTest("123");
            var dict = d.ReturnAMixedType();

            Verify(dict);

            Verify(d.TakeAMixedType(dict));
        }
        public void Desktop_PostDecrementTest()
#endif
        {
            var test = new SDKTest("");
            var d    = test.PostDecrement(0, 1, 10);

            Assert.Equal(0, d[0]);
            Assert.Equal(10, d[1]);
            Assert.Equal(0, d[2]);
        }
        public void Desktop_FunctionCallTest()
#endif
        {
            var test = new SDKTest("");
            var d    = test.ReturnAnObject();

            Assert.NotNull(d);
            Assert.IsAssignableFrom(typeof(SDKTestDefault), d);
            Assert.True(d.IsItTrue());
        }
        public async Task Desktop_FetchPTest()
#endif
        {
            var tester   = new SDKTest("123");
            var response = await tester.GoFetchP();

            Assert.NotNull(response);
            Assert.NotNull(response["args"]);
            Assert.IsAssignableFrom(typeof(IDictionary <String, Object>), response["args"]);
            Assert.Equal(((IDictionary <String, Object>)response["args"])["baz"], "bop");
        }
        public void Desktop_InheritanceTest()
#endif
        {
            var tester  = new SDKTest("123");
            var derived = tester.ReturnADerivedObject();

            Assert.True(derived is SDKTestDefault);
            Assert.True(derived is SDKTestDefaultSubclass);
            var both = tester.ReturnBaseAndDerived();

            Assert.True(both[0] is SDKTestDefault);
            Assert.False(both[0] is SDKTestDefaultSubclass);
            Assert.True(both[1] is SDKTestDefault);
            Assert.True(both[1] is SDKTestDefaultSubclass);
        }
        public void Desktop_ExceptionTest()
#endif
        {
            var d = new SDKTest("123");

            try
            {
                d.ThrowOne();
                Assert.True(false);
            }
            catch (ManticoreException)
            {
                // That's what we wanted.
            }
        }
        public void Desktop_PropertyTest()
#endif
        {
            SDKTestDefault simple = new SDKTestDefault();

            Assert.Equal(1, simple.Test);
            Assert.True(simple.ItsTrue);
            Assert.False(simple.ItsFalse);
            Assert.Null(simple.BlankDecimal);
            Assert.Equal(0, simple.BlankInt);
            Assert.Equal(1, simple.IntOne);
            Assert.Equal(Decimal.Parse("100.01"), simple.DecimalHundredOhOne);

            SDKTest tester = new SDKTest("STRINGISHERE");

            Assert.Equal(1, tester.ItsOne);
            Assert.Equal("STRINGISHERE", tester.StringProperty);
            Assert.Null(tester.AccessorString);
            Assert.NotNull(tester.ComplexType);
            Assert.Equal(Decimal.Parse("100.01"), tester.ComplexType
                         .DecimalHundredOhOne);
        }
Example #14
0
    public void PushMovie()
    {
        //動画を再生する
        SDKTest.SetLoadMovieObj(this);


        if (SDKTest.m_status == 1)
        {
            if (VAMPUnitySDK.show() == false)
            {
                SDKTest.m_status = 0;
            }
        }

        if (SDKTest.m_status == 0)
        {
            VAMPUnitySDK.load();

            panelerr.SetActive(true);
            panelok.SetActive(false);
        }
    }
Example #15
0
 public Main()
 {
     SdkTest = new SDKTest();
     InitializeComponent();
 }