public void TestCenter_TestPlan_WorkItemFieldsShouldBeAccessible() { // arrange var testPlans = testManagement.TestPlans.Query("SELECT * FROM TestPlan"); var microsoftTestPlan = testPlans.FirstOrDefault(testPlan => testPlan.Id == CommonConfiguration.TestPlan_1_Id); var tfsTestPlan = new TfsTestPlan(microsoftTestPlan); // act var tfsTestPlanDetail = new TfsTestPlanDetail(tfsTestPlan); // assert // ReSharper disable once PossibleNullReferenceException try { Assert.AreEqual( microsoftTestPlan.Id.ToString(), tfsTestPlanDetail.PropertyValue("WorkItem.Id", testAdapter.ExpandEnumerable), "WorkItem.Id incorrect."); Assert.AreEqual( microsoftTestPlan.Name, tfsTestPlanDetail.PropertyValue("WorkItem.Name", testAdapter.ExpandEnumerable), "WorkItem.Name incorrect."); } catch (ConfigurationException) { Assert.Inconclusive("Test plans are not yet treated as work items."); } Assert.Inconclusive("Test plans are treated as work items. Remove Inconclusives & try-catch from this test."); }
private static void InitializeTestPlanStructure() { var testPlan = testPlans.FirstOrDefault(x => x.Id == CommonConfiguration.TestPlan_1_Id); var testSuite_1_1 = testSuites.FirstOrDefault(x => x.Id == CommonConfiguration.TestSuite_1_1_TestSuiteId); var testSuite_1_2_1 = testSuites.FirstOrDefault(x => x.Id == CommonConfiguration.TestSuite_1_2_1TestSuiteId); var testCaseInAllTestSuitesAndPlans = testCases.FirstOrDefault(x => x.Id == CommonConfiguration.TestCase_InAllSuitesAndPlans_Id); var testCaseOnlyInSuite1_2_1 = testCases.FirstOrDefault(x => x.Id == CommonConfiguration.TestCase_1_2_1_Id); var testPlanWrapper = new TfsTestPlan((ITestPlan)testPlan); _testPlanDetail = new TfsTestPlanDetail(testPlanWrapper); var testSuite_1_1Wrapper = new TfsTestSuite((IStaticTestSuite)testSuite_1_1, testPlanWrapper); _testSuite_1_1Detail = new TfsTestSuiteDetail(testSuite_1_1Wrapper); var testSuite_1_2_1Wrapper = new TfsTestSuite((IStaticTestSuite)testSuite_1_2_1, testPlanWrapper); var testCaseWrapperAllSuitesAndPlans = new TfsTestCase((ITestCase)testCaseInAllTestSuitesAndPlans, testSuite_1_1Wrapper); _testCaseDetailAllSuitesAndPlans = new TfsTestCaseDetail(testCaseWrapperAllSuitesAndPlans); var testCaseWrapperForTestCaseInSuite1_2_1 = new TfsTestCase((ITestCase)testCaseOnlyInSuite1_2_1, testSuite_1_2_1Wrapper); _testCaseDetailForTestCaseInSuite1_2_1 = new TfsTestCaseDetail(testCaseWrapperForTestCaseInSuite1_2_1); }