Exemple #1
0
        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 AddTestFailureClassAfterAllTestsPassed()
        {
            AllTestClassesPass();

            MockClass mockClass  = new MockClass("TestClass4");
            TestClass testClass4 = new TestClass(mockClass);

            testClass4.Result = TestResultType.Failure;
            testClasses.Add(testClass4);

            Assert.AreEqual(TestResultType.Failure, testClasses.Result);
        }
		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 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 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 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;
		}
		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);
		}		
		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("ICSharpCode.SharpDevelop.Tests.MainTestFixture.BaseBaseTest");
			testResult.IsFailure = true;
			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("RootNamespace.MyTestFixture.BaseMethod");
			testResult.IsFailure = true;
			testClasses.UpdateTestResult(testResult);
			
			Assert.AreEqual(TestResultType.Failure, testClass.Result);
		}