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); }
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); }
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); }
static void Main() { using (var game = new Test()) game.Run(); }
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); }
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); }
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); }
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); }
/// <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); }