Ejemplo n.º 1
0
 public void DollarSignInAssertForPropertyGetters()
 {
     var t = new Test {
         Member = "QuickTest.Tests.RunTests+Person.Personality",
         ThisString = "{ Personality:20 }",
         AssertString = "$ > 15 && $ < 30",
         TestType = TestType.PropertyGetter,
     };
     t.Run ();
     Assert.AreEqual (TestResult.Pass, t.Result, t.FailInfo);
 }
Ejemplo n.º 2
0
 public void ProcedureAssert()
 {
     var t = new Test {
         Member = "QuickTest.Tests.RunTests+Person.LowerCase",
         ThisString = "{ FirstName: \"Frank\", LastName:\"Krueger\" }",
         AssertString = "FullName == \"frank krueger\"",
         TestType = TestType.Procedure,
     };
     t.Run ();
     Assert.AreEqual (TestResult.Pass, t.Result, t.FailInfo);
 }
Ejemplo n.º 3
0
 public void ObjectLiteralArgs()
 {
     var t = new Test {
         Member = "QuickTest.Tests.RunTests+Person.SetLocation",
         ThisString = "{ FirstName: \"Frank\", LastName:\"Krueger\" }",
         AssertString = "Location.Lat == 1.0",
         TestType = TestType.Procedure,
     };
     t.Arguments.Add (new TestArgument { Name = "loc", ValueString = "{Lat=1,Lon=2}", ValueType = "QuickTest.Tests.RunTests+Location", });
     t.Run ();
     Assert.AreEqual (TestResult.Pass, t.Result, t.FailInfo);
 }
Ejemplo n.º 4
0
 static void Main()
 {
     using (var game = new Test())
         game.Run();
 }
Ejemplo n.º 5
0
 public void PropertyGetterBadAssert()
 {
     var t = new Test {
         Member = "QuickTest.Tests.RunTests+Person.FullName",
         ThisString = "{ FirstName: \"Frank\", LastName:\"Krueger\" }",
         AssertString = "FullName == \"Frank Krueger\" && FirstName == \"Foo\"",
         TestType = TestType.PropertyGetter,
     };
     t.Run ();
     Assert.AreEqual (TestResult.Fail, t.Result, t.FailInfo);
     Assert.AreEqual ("Assert Fail", t.FailInfo);
 }
Ejemplo n.º 6
0
 public void PropertySetterAssert()
 {
     var t = new Test {
         Member = "QuickTest.Tests.RunTests+Person.FirstName",
         ThisString = "{ FirstName: \"Frank\", LastName:\"Krueger\" }",
         AssertString = "FullName == \"Alva Krueger\"",
         TestType = TestType.PropertySetter,
     };
     t.Arguments.Add (new TestArgument { Name = "value", ValueString = "\"Alva\"", ValueType = "System.String" });
     t.Run ();
     Assert.AreEqual (TestResult.Pass, t.Result, t.FailInfo);
 }
Ejemplo n.º 7
0
 public void PropertyGetterUnknown()
 {
     var t = new Test {
         Member = "QuickTest.Tests.RunTests+Person.FullName",
         ThisString = "{ FirstName: \"Frank\", LastName:\"Krueger\" }",
         TestType = TestType.PropertyGetter,
     };
     t.Run ();
     Assert.AreEqual (TestResult.Unknown, t.Result, t.FailInfo);
 }
Ejemplo n.º 8
0
 public void PropertyGetterBadExpected()
 {
     var t = new Test {
         Member = "QuickTest.Tests.RunTests+Person.FullName",
         ThisString = "{ FirstName: \"Frank\", LastName:\"Krueger\" }",
         TestType = TestType.PropertyGetter,
         ExpectedValueString = "Frank A. Krueger",
     };
     t.Run ();
     Assert.AreEqual (TestResult.Fail, t.Result);
     Assert.AreEqual ("Expected Value Fail", t.FailInfo);
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Programmets startpunkt.
        /// </summary>
        static void Main()
        {
            bool exit = false;
            NoiseObjectType type = NoiseObjectType.Indefinite;

            do
            {
                switch (GetMenuChoice())
                {
                    case 0:
                        exit = true;
                        continue;

                    case 1:
                        type = NoiseObjectType.Cat;
                        break;

                    case 2:
                        type = NoiseObjectType.Dog;
                        break;

                    case 3:
                        type = NoiseObjectType.Car;
                        break;

                    case 4:
                        Console.Clear();
                        Test test = new Test();
                        test.Run();
                        continue;

            #if DEBUG
                    default:
                        Debug.Assert(false, "Hantering av menyalternativet saknas.");
                        continue;
            #endif
                }

                Console.Clear();
                INoise noise = CreateNoiseObject(type);
                noise.MakeNoise();
                ContinueOnKeyPressed();
            } while (!exit);
        }