public XmlTestCase GetTestCase(XmlFixture fixture, XmlTestCase testCase)
        {
            if (fixture == null)
                throw new ArgumentNullException("fixture");
            if (testCase == null)
                throw new ArgumentNullException("testCase");

            return GetTestCase(fixture.Name, testCase.Name);
        }
Exemple #2
0
        public XmlTestCase GetTestCase(string fixtureName, string testCaseName)
        {
            XmlTestCase tc = null;

            this.testCases.TryGetValue(
                XmlTestCase.GetTestCaseFullName(fixtureName, testCaseName),
                out tc);
            return(tc);
        }
Exemple #3
0
        public XmlTestCase GetTestCase(XmlFixture fixture, XmlTestCase testCase)
        {
            if (fixture == null)
            {
                throw new ArgumentNullException("fixture");
            }
            if (testCase == null)
            {
                throw new ArgumentNullException("testCase");
            }

            return(GetTestCase(fixture.Name, testCase.Name));
        }
        public void AfterTestCase(ITestCase test)
        {
            if (this.TestBatchSearcher != null)
            {
                XmlTestCase previous = this.TestBatchSearcher.GetTestCase(this.currentFixture, this.currentTest);
                if (previous == null)
                {
                    this.currentTest.History = XmlTestHistory.New;
                }
                else
                {
                    if (
                        this.currentTest.State == TestState.Success
                        && previous.State != TestState.Success)
                    {
                        this.currentTest.History = XmlTestHistory.Fixed;
                    }
                    else if (
                        this.currentTest.State == TestState.Failure &&
                        previous.State != TestState.Failure
                        )
                    {
                        this.currentTest.History = XmlTestHistory.Failure;
                    }
                }
            }

            if (!this.ShowTestCaseOnSuccess && this.currentTest.State == TestState.Success)
            {
                this.currentTest.SetUp = null;
                this.currentTest.Test = null;
                this.currentTest.TearDown = null;
            }
            this.currentTest = null;
        }
 public void BeforeTestCase(ITestCase test)
 {
     this.currentTest = new XmlTestCase(String.Format("{0}t{1}",
                 this.currentFixture.ID,
                 this.currentFixture.TestCases.Count),
                 test.Name);
     this.currentFixture.TestCases.Add(this.currentTest);
 }