Esempio n. 1
0
        protected override void Run()
        {
            try
            {
                mDebugger.Send("Run");

                // C#
                WhileLoopTests.Execute();
                ForeachLoopTests.Execute();

                // System
                ObjectTests.Execute();
                ArrayTests.Execute();
                StringTest.Execute();
                ByteTest.Execute();
                SByteTest.Execute();
                Int16Test.Execute();
                UInt16Test.Execute();
                Int32Test.Execute();
                UInt32Test.Execute();
                Int64Test.Execute();
                UInt64Test.Execute();
                CharTest.Execute();
                BooleanTest.Execute();
                SingleTest.Execute();
                DoubleTest.Execute();
                MathTest.Execute();
                ConvertTests.Execute();

                //mDebugger.Send("Thread test start of 500 ms");
                //ThreadTest.Execute();
                //mDebugger.Send("Thread test end");

                //DecimalTest.Execute();
                BitConverterTest.Execute();
                UnsafeCodeTest.Execute();
                DelegatesTest.Execute();
                RandomTests.Execute();

                // System.Collections.Generic
                ListTest.Execute();
                QueueTest.Execute();
                DictionaryTest.Execute();

                // System.Text
                EncodingTest.Execute();

                TestController.Completed();
            }
            catch (Exception e)
            {
                mDebugger.Send("Exception occurred: " + e.Message);
                mDebugger.Send(e.Message);
                Console.WriteLine("Exception occurred");
                Console.WriteLine(e.Message);
                TestController.Failed();
            }
        }
 public void GetFloat_Test(float defaultFloat)
 {
     foreach (var obj in ObjectTests.GetImplementors(_mocks, _mocks.GameState()))
     {
         Assert.IsTrue(!obj.Properties.Floats.AllProperties().ContainsKey(VAR_NAME));
         Assert.AreEqual(defaultFloat, obj.Properties.Floats.GetValue(VAR_NAME, defaultFloat));
         Assert.IsTrue(obj.Properties.Floats.AllProperties().ContainsKey(VAR_NAME));
         Assert.AreEqual(defaultFloat, obj.Properties.Floats.GetValue(VAR_NAME));
     }
 }
 public void GetString_Test(string defaultString)
 {
     foreach (var obj in ObjectTests.GetImplementors(_mocks, _mocks.GameState()))
     {
         Assert.IsTrue(!obj.Properties.Strings.AllProperties().ContainsKey(VAR_NAME));
         Assert.AreEqual(defaultString, obj.Properties.Strings.GetValue(VAR_NAME, defaultString));
         Assert.IsTrue(obj.Properties.Strings.AllProperties().ContainsKey(VAR_NAME));
         Assert.AreEqual(defaultString, obj.Properties.Strings.GetValue(VAR_NAME));
     }
 }
 public void SetFloat_GetFloat_Test(float floatToSet, bool getFloatFirst)
 {
     foreach (var obj in ObjectTests.GetImplementors(_mocks, _mocks.GameState()))
     {
         Assert.IsTrue(!obj.Properties.Floats.AllProperties().ContainsKey(VAR_NAME));
         if (getFloatFirst)
         {
             Assert.AreEqual(999f, obj.Properties.Floats.GetValue(VAR_NAME, 999));
         }
         obj.Properties.Floats.SetValue(VAR_NAME, floatToSet);
         Assert.IsTrue(obj.Properties.Floats.AllProperties().ContainsKey(VAR_NAME));
         Assert.AreEqual(floatToSet, obj.Properties.Floats.GetValue(VAR_NAME));
         Assert.AreEqual(floatToSet, obj.Properties.Floats.GetValue(VAR_NAME, 999f));
     }
 }
 public void SetString_GetString_Test(string stringToSet, bool getStringFirst)
 {
     foreach (var obj in ObjectTests.GetImplementors(_mocks, _mocks.GameState()))
     {
         Assert.IsTrue(!obj.Properties.Strings.AllProperties().ContainsKey(VAR_NAME));
         if (getStringFirst)
         {
             Assert.AreEqual("", obj.Properties.Strings.GetValue(VAR_NAME, ""));
         }
         obj.Properties.Strings.SetValue(VAR_NAME, stringToSet);
         Assert.IsTrue(obj.Properties.Strings.AllProperties().ContainsKey(VAR_NAME));
         Assert.AreEqual(stringToSet, obj.Properties.Strings.GetValue(VAR_NAME));
         Assert.AreEqual(stringToSet, obj.Properties.Strings.GetValue(VAR_NAME, ""));
     }
 }
 public void SetBool_GetBool_Test(bool boolToSet, bool getBoolFirst)
 {
     foreach (var obj in ObjectTests.GetImplementors(_mocks, _mocks.GameState()))
     {
         Assert.IsTrue(!obj.Properties.Bools.AllProperties().ContainsKey(VAR_NAME));
         if (getBoolFirst)
         {
             Assert.AreEqual(false, obj.Properties.Bools.GetValue(VAR_NAME, false));
         }
         obj.Properties.Bools.SetValue(VAR_NAME, boolToSet);
         Assert.IsTrue(obj.Properties.Bools.AllProperties().ContainsKey(VAR_NAME));
         Assert.AreEqual(boolToSet, obj.Properties.Bools.GetValue(VAR_NAME));
         Assert.AreEqual(boolToSet, obj.Properties.Bools.GetValue(VAR_NAME, false));
     }
 }
Esempio n. 7
0
        protected override void Run()
        {
            try
            {
                mDebugger.Send("Run");

                CSharp.WhileLoopTests.Execute();
                CSharp.ForeachLoopTests.Execute();

                ObjectTests.Execute();
                ArrayTests.Execute();
                StringTest.Execute();
                ByteTest.Execute();
                SByteTest.Execute();
                Int16Test.Execute();
                UInt16Test.Execute();
                Int32Test.Execute();
                UInt32Test.Execute();
                Int64Test.Execute();
                UInt64Test.Execute();
                CharTest.Execute();
                BooleanTest.Execute();
                SingleTest.Execute();
                DoubleTest.Execute();
                //DecimalTest.Execute();
                BitConverterTest.Execute();
                UnsafeCodeTest.Execute();
                DelegatesTest.Execute();

                System.Collections.Generic.ListTest.Execute();
                System.Collections.Generic.QueueTest.Execute();
                //System.Collections.Generic.DictionaryTest.Execute();

                TestController.Completed();
            }
            catch (Exception e)
            {
                mDebugger.Send("Exception occurred: " + e.Message);
                mDebugger.Send(e.Message);
                Console.WriteLine("Exception occurred");
                Console.WriteLine(e.Message);
                TestController.Failed();
            }
        }