Exemple #1
0
        public void TestCenter_CustomObjects_ShouldContainCustomPropertyWorkItemsForTestResult()
        {
            var testRun = _testManagement.TestRuns.Create();

            testRun.AddTest(_testCase.Id, _testConfiguration.Id, _testManagement.TfsIdentityStore.FindByAccountName("Administrator"));
            testRun.Save();

            var testResult = testRun.QueryResults()[0];
            var iteration  = testResult.CreateIteration(1);

            testResult.Iterations.Add(iteration);

            testRun.Save();

            var testCaseWrapper = new TfsTestResult(testResult, _testCase.Id);

            var testCaseDetail = new TfsTestResultDetail(testCaseWrapper, testCaseWrapper.OriginalTestResult.TestRunId);

            var testInt = 2;

            testCaseDetail.AddCustomObjects("ASampleProperty", testInt);

            Assert.AreEqual("2", testCaseDetail.PropertyValue("ASampleProperty", x => x));
            Assert.AreEqual("2", testCaseDetail.PropertyValue("ASampleProperty.ToString()", x => x));
        }
Exemple #2
0
        public void TestCenter_TestResult_PropertyLinkedWorkItemsForTestResultShouldBeList()
        {
            var testRun = _testManagement.TestRuns.Create();

            testRun.AddTest(_testCase.Id, _testConfiguration.Id, _testManagement.TfsIdentityStore.FindByAccountName("Administrator"));
            testRun.Save();

            var testResult = testRun.QueryResults()[0];
            var iteration  = testResult.CreateIteration(1);

            testResult.Iterations.Add(iteration);

            // note that these are shuffled
            var sharedStepResult = iteration.CreateSharedStepResult(_testCase.Actions[2].Id, _sharedStep.Id);

            sharedStepResult.Actions.Add(iteration.CreateStepResult(_sharedStep.Actions[0].Id));
            sharedStepResult.Actions.Add(iteration.CreateStepResult(_sharedStep.Actions[1].Id));
            iteration.Actions.Add(sharedStepResult);

            iteration.Actions.Add(iteration.CreateStepResult(_testCase.Actions[0].Id));
            iteration.Actions.Add(iteration.CreateStepResult(_testCase.Actions[3].Id));
            iteration.Actions.Add(iteration.CreateStepResult(_testCase.Actions[1].Id));

            testRun.Save();

            var testCaseWrapper = new TfsTestResult(testResult, _testCase.Id);
            var testCaseDetail  = new TfsTestResultDetail(testCaseWrapper, testCaseWrapper.OriginalTestResult.TestRunId);

            Assert.AreEqual(typeof(List <WorkItem>), testCaseDetail.LinkedWorkItemsForTestResult.GetType());
        }
Exemple #3
0
        public void TestCenter_TestActionResult_ShouldInsertIterationVariablesIntoParameterWithSpecialChars()
        {
            var testRun = _testManagement.TestRuns.Create();

            testRun.AddTest(_testCase.Id, _testConfiguration.Id, _testManagement.TfsIdentityStore.FindByAccountName("Administrator"));
            testRun.Save();

            var testResult = testRun.QueryResults()[0];
            var iteration  = testResult.CreateIteration(1);

            testResult.Iterations.Add(iteration);

            // note that these are shuffled
            var sharedStepResult = iteration.CreateSharedStepResult(_testCase.Actions[2].Id, _sharedStep.Id);

            sharedStepResult.Actions.Add(iteration.CreateStepResult(_sharedStep.Actions[0].Id));
            var sharedStepActionResult2 = iteration.CreateStepResult(_sharedStep.Actions[1].Id);

            sharedStepActionResult2.Parameters.Add("ParametersDontLikeSpecialChars", "ShouldWorkDespiteSpecialChar", "MyActualValue");
            sharedStepResult.Actions.Add(sharedStepActionResult2);

            iteration.Actions.Add(sharedStepResult);
            iteration.Actions.Add(iteration.CreateStepResult(_testCase.Actions[0].Id));
            iteration.Actions.Add(iteration.CreateStepResult(_testCase.Actions[1].Id));
            iteration.Actions.Add(iteration.CreateStepResult(_testCase.Actions[3].Id));

            testRun.Save();

            var testCaseWrapper = new TfsTestResult(testResult, _testCase.Id);
            var testCaseDetail  = new TfsTestResultDetail(testCaseWrapper, testCaseWrapper.OriginalTestResult.TestRunId);

            Assert.AreEqual("Second Shared Step .: ShouldWorkDespiteSpecialChar", testCaseDetail.PropertyValue("Iterations[0].Actions[3].Title", x => x));
        }
Exemple #4
0
        public void TestCenter_TestActionResult_ShouldInsertIterationVariablesIntoParameter()
        {
            var testRun = _testManagement.TestRuns.Create();

            testRun.AddTest(_testCase.Id, _testConfiguration.Id, _testManagement.TfsIdentityStore.FindByAccountName("Administrator"));
            testRun.Save();

            var testResult = testRun.QueryResults()[0];
            var iteration  = testResult.CreateIteration(1);

            testResult.Iterations.Add(iteration);

            iteration.Actions.Add(iteration.CreateStepResult(_testCase.Actions[0].Id));
            iteration.Actions.Add(iteration.CreateStepResult(_testCase.Actions[1].Id));

            var sharedStepResult = iteration.CreateSharedStepResult(_testCase.Actions[2].Id, _sharedStep.Id);

            sharedStepResult.Actions.Add(iteration.CreateStepResult(_sharedStep.Actions[0].Id));
            sharedStepResult.Actions.Add(iteration.CreateStepResult(_sharedStep.Actions[1].Id));
            iteration.Actions.Add(sharedStepResult);

            var testStepResult = iteration.CreateStepResult(_testCase.Actions[3].Id);

            testStepResult.Parameters.Add("DescriptionParameter", "MyExpectedDescriptionValue", "MyActualValue");
            testStepResult.Parameters.Add("ExpectedResultParameter", "MyExpectedResultValue", "MyActualValue");
            iteration.Actions.Add(testStepResult);

            testRun.Save();

            var testCaseWrapper = new TfsTestResult(testResult, _testCase.Id);
            var testCaseDetail  = new TfsTestResultDetail(testCaseWrapper, testCaseWrapper.OriginalTestResult.TestRunId);

            Assert.AreEqual("MyExpectedDescriptionValue", testCaseDetail.PropertyValue("Iterations[0].Actions[4].Title", x => x));
            Assert.AreEqual("MyExpectedResultValue", testCaseDetail.PropertyValue("Iterations[0].Actions[4].ExpectedResult", x => x));
        }
Exemple #5
0
        public void TestCenter_TestActionResult_ShouldAssignStepNumbersAsDefinedInTestCase()
        {
            var testRun = _testManagement.TestRuns.Create();

            testRun.AddTest(_testCase.Id, _testConfiguration.Id, _testManagement.TfsIdentityStore.FindByAccountName("Administrator"));
            testRun.Save();

            var testResult = testRun.QueryResults()[0];
            var iteration  = testResult.CreateIteration(1);

            testResult.Iterations.Add(iteration);

            // note that these are shuffled
            var sharedStepResult = iteration.CreateSharedStepResult(_testCase.Actions[2].Id, _sharedStep.Id);

            sharedStepResult.Actions.Add(iteration.CreateStepResult(_sharedStep.Actions[0].Id));
            sharedStepResult.Actions.Add(iteration.CreateStepResult(_sharedStep.Actions[1].Id));
            iteration.Actions.Add(sharedStepResult);

            iteration.Actions.Add(iteration.CreateStepResult(_testCase.Actions[0].Id));
            iteration.Actions.Add(iteration.CreateStepResult(_testCase.Actions[3].Id));
            iteration.Actions.Add(iteration.CreateStepResult(_testCase.Actions[1].Id));

            testRun.Save();

            var testCaseWrapper = new TfsTestResult(testResult, _testCase.Id);
            var testCaseDetail  = new TfsTestResultDetail(testCaseWrapper, testCaseWrapper.OriginalTestResult.TestRunId);

            Assert.AreEqual("3.2", testCaseDetail.PropertyValue("Iterations[0].Actions[3].StepNumber", x => x));
        }
Exemple #6
0
        public void TestCenter_TestActionResult_ShouldProvideTestNumberProperty()
        {
            var testRun = _testManagement.TestRuns.Create();

            testRun.AddTest(_testCase.Id, _testConfiguration.Id, _testManagement.TfsIdentityStore.FindByAccountName("Administrator"));
            testRun.Save();

            var testResult = testRun.QueryResults()[0];
            var iteration  = testResult.CreateIteration(1);

            testResult.Iterations.Add(iteration);

            var stepResult = iteration.CreateStepResult(_testCase.Actions[0].Id);

            iteration.Actions.Add(stepResult);

            testRun.Save();

            var testCaseWrapper = new TfsTestResult(testResult, _testCase.Id);
            var testCaseDetail  = new TfsTestResultDetail(testCaseWrapper, testCaseWrapper.OriginalTestResult.TestRunId);

            Assert.AreEqual("1", testCaseDetail.PropertyValue("Iterations[0].Actions[0].StepNumber", x => x));
        }