Esempio n. 1
0
        public void TestMethod1()
        {
            MyClass.Buffer = new StringBuilder();
            UnitTestManager.Call(() => new Test().Hello());
            var txt = MyClass.Buffer.ToString();

            Assert.AreEqual("OnReady,OnApiCreated,OnPropertiesParsed,OnArgumentsParsed,OnEnding,", txt);
        }
Esempio n. 2
0
        public void HelloAsyncTest()
        {
            var r = UnitTestManager.Call(() => new Test().HelloAsync());

            if (r.Exception != null)
            {
                throw r.Exception;
            }
            Assert.AreEqual("Hello", r.Result);
        }
Esempio n. 3
0
        public void CheckPropAsyncTest()
        {
            var r = UnitTestManager.Call(() => new Test()
            {
                Name = "abc"
            }.CheckPropAsync("abc"));

            if (r.Exception != null)
            {
                throw r.Exception;
            }

            var r2 = UnitTestManager.Call(() => new Test()
            {
                Name = "abc1"
            }.CheckPropAsync("abc"));

            if (r2.Exception == null)
            {
                Assert.Fail();
            }
        }
Esempio n. 4
0
        public void NotApiTest()
        {
            var r = UnitTestManager.Call(() => new Test().NotApi());

            Assert.IsInstanceOfType(r.Exception, typeof(ApiNotFoundException));
        }