public void FirstTaskAddedToTaskServiceIsErrorTask()
        {
            Task           expectedTask   = TestResultTask.Create(errorTestResult, testProject);
            TaskComparison taskComparison = new TaskComparison(expectedTask, context.MockTaskService.Tasks[0]);

            Assert.IsTrue(taskComparison.IsMatch, taskComparison.MismatchReason);
        }
        public void SecondTaskAddedToTaskServiceIsWarningTask()
        {
            Task           expectedTask   = TestResultTask.Create(warningTestResult, testProject);
            TaskComparison taskComparison = new TaskComparison(expectedTask, context.MockTaskService.Tasks[1]);

            Assert.IsTrue(taskComparison.IsMatch, taskComparison.MismatchReason);
        }
        public void Init()
        {
            TestResult testResult = new TestResult("MyNamespace.MyTests");

            testResult.ResultType = TestResultType.Ignored;
            task = TestResultTask.Create(testResult, null);
        }
        public void Init()
        {
            string      className   = "MyNamespace.MyTests";
            TestProject testProject =
                TestProjectHelper.CreateTestProjectWithTestClassAndSingleTestMethod(className, "MyTestMethod");

            TestResult testResult = new TestResult("MyNamespace.MyTests.MyTestMethod");

            testResult.ResultType = TestResultType.Ignored;
            testResult.Message    = "Test ignored";

            task = TestResultTask.Create(testResult, testProject);
        }
        public void Init()
        {
            TestResult testResult = new TestResult("MyNamespace.MyTests");

            testResult.ResultType = TestResultType.Failure;
            testResult.Message    = "Test failed";
            testResult.StackTrace =
                "Test Error : MyTest.Test\r\n" +
                "at TestResultTask.Create() in c:\\projects\\SharpDevelop\\TestResultTask.cs:line 45\r\n" +
                "at MyTest.Test() in c:\\myprojects\\test\\..\\test\\mytest.cs:line 28\r\n" +
                "";
            testResult.StackTraceFilePosition =
                new FilePosition("c:\\myprojects\\test\\..\\test\\mytest.cs", 28, 1);
            task = TestResultTask.Create(testResult, null);
        }
Ejemplo n.º 6
0
        public void Init()
        {
            MockRegisteredTestFrameworks testFrameworks = new MockRegisteredTestFrameworks();
            MockClass c         = MockClass.CreateMockClassWithoutAnyAttributes();
            TestClass testClass = new TestClass(c, testFrameworks);

            TestProject testProject = new TestProject(c.Project, c.ProjectContent, testFrameworks);

            testProject.TestClasses.Add(testClass);

            TestResult testResult = new TestResult("MyNamespace.MyTests.MyTestMethod");

            testResult.ResultType = TestResultType.Ignored;
            testResult.Message    = "Test ignored";

            task = TestResultTask.Create(testResult, testProject);
        }
        void AddTaskForTestResult(TestResult testResult)
        {
            SDTask task = TestResultTask.Create(testResult, currentProjectBeingTested);

            taskService.Add(task);
        }