public void Init() { testFrameworks = new MockTestFrameworksWithNUnitFrameworkSupport(); testClassesResultChanged = false; testClasses = new TestClassCollection(); // TestClass1. MockClass mockClass = new MockClass("TestClass1"); testClass1 = new TestClass(mockClass, testFrameworks); testClasses.Add(testClass1); // TestClass2. mockClass = new MockClass("TestClass2"); testClass2 = new TestClass(mockClass, testFrameworks); testClasses.Add(testClass2); // TestClass3. mockClass = new MockClass("TestClass3"); testClass3 = new TestClass(mockClass, testFrameworks); testClasses.Add(testClass3); testClasses.ResultChanged += TestClassesResultChanged; }
public void UpdateTestResultUsingPrefixBaseClassName() { TestClassCollection testClasses = new TestClassCollection(); testClasses.Add(testClass); TestResult testResult = new TestResult("RootNamespace.MyTestFixture.TestFixtureBase.BaseMethod"); testResult.ResultType = TestResultType.Failure; testClasses.UpdateTestResult(testResult); Assert.AreEqual(TestResultType.Failure, testClass.Result); }
public void CustomCollection() { var expected = new TestClassCollection { TestClassPrimitiveTypes.Create() }; var actual = new SerializationSupport().Assert(expected, @"<?xml version=""1.0"" encoding=""utf-8""?><TestClassCollection xmlns=""clr-namespace:ExtendedXmlSerializer.Tests.TestObject;assembly=ExtendedXmlSerializer.Tests""><TestClassPrimitiveTypes><PropString>TestString</PropString><PropInt>-1</PropInt><PropuInt>2234</PropuInt><PropDecimal>3.346</PropDecimal><PropDecimalMinValue>-79228162514264337593543950335</PropDecimalMinValue><PropDecimalMaxValue>79228162514264337593543950335</PropDecimalMaxValue><PropFloat>7.4432</PropFloat><PropFloatNaN>NaN</PropFloatNaN><PropFloatPositiveInfinity>INF</PropFloatPositiveInfinity><PropFloatNegativeInfinity>-INF</PropFloatNegativeInfinity><PropFloatMinValue>-3.40282347E+38</PropFloatMinValue><PropFloatMaxValue>3.40282347E+38</PropFloatMaxValue><PropDouble>3.4234</PropDouble><PropDoubleNaN>NaN</PropDoubleNaN><PropDoublePositiveInfinity>INF</PropDoublePositiveInfinity><PropDoubleNegativeInfinity>-INF</PropDoubleNegativeInfinity><PropDoubleMinValue>-1.7976931348623157E+308</PropDoubleMinValue><PropDoubleMaxValue>1.7976931348623157E+308</PropDoubleMaxValue><PropEnum>EnumValue1</PropEnum><PropLong>234234142</PropLong><PropUlong>2345352534</PropUlong><PropShort>23</PropShort><PropUshort>2344</PropUshort><PropDateTime>2014-01-23T00:00:00</PropDateTime><PropByte>23</PropByte><PropSbyte>33</PropSbyte><PropChar>g</PropChar></TestClassPrimitiveTypes></TestClassCollection>"); actual.Should().BeEquivalentTo(expected); }
public void ClosedGenericCollectionOfObject() { var obj = new TestClassCollection { TestClassPrimitiveTypes.Create(), TestClassPrimitiveTypes.Create() }; CheckSerializationAndDeserialization( "ExtendedXmlSerializer.Tests.Legacy.Resources.ClosedGenericCollectionOfObject.xml", obj); CheckCompatibilityWithDefaultSerializator(obj); }
public void UpdateTestResult() { TestClassCollection testClasses = new TestClassCollection(); testClasses.Add(testClass); TestResult testResult = new TestResult("ICSharpCode.SharpDevelop.Tests.CecilLayerTests.InheritanceTests"); testResult.ResultType = TestResultType.Failure; testClasses.UpdateTestResult(testResult); Assert.AreEqual(TestResultType.Failure, testClass.Result); }
public void UpdateTestResult() { TestClassCollection testClasses = new TestClassCollection(); testClasses.Add(testClass); TestResult testResult = new TestResult("RootNamespace.MyTestFixture.BaseMethod"); testResult.IsFailure = true; testClasses.UpdateTestResult(testResult); Assert.AreEqual(TestResultType.Failure, testClass.Result); }
public void UpdateTestResult() { TestClassCollection testClasses = new TestClassCollection(); testClasses.Add(testClass); TestResult testResult = new TestResult("ICSharpCode.SharpDevelop.Tests.MainTestFixture.BaseBaseTest"); testResult.IsFailure = true; testClasses.UpdateTestResult(testResult); Assert.AreEqual(TestResultType.Failure, testClass.Result); }
public void ClosedGenericCollectionOfObject() { var obj = new TestClassCollection { new TestClassPrimitiveTypes(), new TestClassPrimitiveTypes() }; obj[0].Init(); obj[1].Init(); CheckSerializationAndDeserialization("ExtendedXmlSerializerTest.Resources.ClosedGenericCollectionOfObject.xml", obj); CheckCompatibilityWithDefaultSerializator(obj); }
public void Find_Generic_Enumerable_Method() { MethodInfo method; var class1 = Enumerable.Empty <TestClass>(); method = ExtensionMethodFinder.FindExtensionMethod(new NullCacheProvider(), typeof(IEnumerable <TestClass>), new object[] { }, "GenericMethod", false); Assert.IsNotNull(method); method.Invoke(null, new object[] { class1 }); var class2 = new TestClassCollection(); method = ExtensionMethodFinder.FindExtensionMethod(new NullCacheProvider(), typeof(TestClassCollection), new object[] { }, "GenericMethod", false); Assert.IsNotNull(method); method.Invoke(null, new object[] { class2 }); }
public void Init() { testClassesResultChanged = false; testClasses = new TestClassCollection(); // TestClass1. MockClass mockClass = new MockClass("TestClass1"); testClass1 = new TestClass(mockClass); testClasses.Add(testClass1); // TestClass2. mockClass = new MockClass("TestClass2"); testClass2 = new TestClass(mockClass); testClasses.Add(testClass2); // TestClass3. mockClass = new MockClass("TestClass3"); testClass3 = new TestClass(mockClass); testClasses.Add(testClass3); testClasses.ResultChanged += TestClassesResultChanged; }
public void Init() { testClassesResultChanged = false; testClasses = new TestClassCollection(); // TestClass1. MockClass mockClass = new MockClass("TestClass1"); testClass1 = new TestClass(mockClass); testClasses.Add(testClass1); // TestClass2. mockClass = new MockClass("TestClass2"); testClass2 = new TestClass(mockClass); testClasses.Add(testClass2); // TestClass3. mockClass = new MockClass("TestClass3"); testClass3 = new TestClass(mockClass); testClasses.Add(testClass3); testClasses.ResultChanged += TestClassesResultChanged; }
public void Init() { testFrameworks = new MockTestFrameworksWithNUnitFrameworkSupport(); testClassesResultChanged = false; testClasses = new TestClassCollection(); // TestClass1. MockClass mockClass = new MockClass("TestClass1"); testClass1 = new TestClass(mockClass, testFrameworks); testClasses.Add(testClass1); // TestClass2. mockClass = new MockClass("TestClass2"); testClass2 = new TestClass(mockClass, testFrameworks); testClasses.Add(testClass2); // TestClass3. mockClass = new MockClass("TestClass3"); testClass3 = new TestClass(mockClass, testFrameworks); testClasses.Add(testClass3); testClasses.ResultChanged += TestClassesResultChanged; }
void GetTestClasses() { testClasses = new TestClassCollection(); foreach (IClass c in projectContent.Classes) { if (IsTestClass(c)) { if (!testClasses.Contains(c.FullyQualifiedName)) { testClasses.Add(CreateTestClass(c)); } } foreach (IClass innerClass in c.InnerClasses) { if (IsTestClass(innerClass)) { if (!testClasses.Contains(innerClass.DotNetName)) { testClasses.Add(CreateTestClass(innerClass)); } } } } }
public void UpdateTestResult() { TestClassCollection testClasses = new TestClassCollection(); testClasses.Add(testClass); TestResult testResult = new TestResult("RootNamespace.MyTestFixture.BaseMethod"); testResult.IsFailure = true; testClasses.UpdateTestResult(testResult); Assert.AreEqual(TestResultType.Failure, testClass.Result); }
public void UpdateTestResult() { TestClassCollection testClasses = new TestClassCollection(); testClasses.Add(testClass); TestResult testResult = new TestResult("ICSharpCode.SharpDevelop.Tests.CecilLayerTests.InheritanceTests"); testResult.ResultType = TestResultType.Failure; testClasses.UpdateTestResult(testResult); Assert.AreEqual(TestResultType.Failure, testClass.Result); }
/// <summary> /// Gets the test classes for this namespace. /// </summary> void GetTestClasses() { testClasses = new TestClassCollection(); foreach (TestClass c in TestProject.GetTestClasses(fullNamespace)) { testClasses.Add(c); } testClasses.ResultChanged += TestClassesResultChanged; }
public void UpdateTestResult() { TestClassCollection testClasses = new TestClassCollection(); testClasses.Add(testClass); TestResult testResult = new TestResult("ICSharpCode.SharpDevelop.Tests.MainTestFixture.BaseBaseTest"); testResult.IsFailure = true; testClasses.UpdateTestResult(testResult); Assert.AreEqual(TestResultType.Failure, testClass.Result); }