public void BehaviorOfWordSyncAdapterWithUnknownFieldValues() { const string hierarachyLevel0TemplateName = "HierarchieTemplateLevel0"; const string hierarachyLevel1TemplateName = "HierarchieTemplateLevel1"; //Create Configuration IConfiguration conf = CommonConfiguration.Configuration; var featureBaseConfiguration = CommonConfiguration.GetSimpleFieldConfiguration("Requirement", Direction.OtherToTfs, FieldValueType.PlainText, "System.Title").GetConfigurationItems().Single(); var featureHierarchieLevel0Configuration = CommonConfiguration.GetWorkItemSubtypeConfiguration(hierarachyLevel0TemplateName, "Requirement", Direction.OtherToTfs, FieldValueType.PlainText, "System.Title", "HierarchyLevel", "0").GetConfigurationItems().Single(); var featureHierarchieLevel1Configuration = CommonConfiguration.GetWorkItemSubtypeConfiguration(hierarachyLevel1TemplateName, "Requirement", Direction.OtherToTfs, FieldValueType.PlainText, "System.Title", "HierarchyLevel", "1").GetConfigurationItems().Single(); conf.GetConfigurationItems().Add(featureBaseConfiguration); conf.GetConfigurationItems().Add(featureHierarchieLevel0Configuration); conf.GetConfigurationItems().Add(featureHierarchieLevel1Configuration); var range = _testDocument.ActiveWindow.Document.Range(); _testDocument.Tables.Add(range, 4, 1); _testDocument.Tables[1].Cell(1, 1).Range.Text = "1Header"; range.InsertParagraphAfter(); range.Collapse(WdCollapseDirection.wdCollapseEnd); _testDocument.Tables.Add(range, 4, 1); _testDocument.Tables[2].Cell(1, 1).Range.Text = "2Header"; range = _testDocument.ActiveWindow.Document.Range(); range.Collapse(WdCollapseDirection.wdCollapseEnd); range.InsertParagraphAfter(); range.Collapse(WdCollapseDirection.wdCollapseEnd); _testDocument.Tables.Add(range, 5, 5); _testDocument.Tables[3].Cell(1, 1).Range.Text = "Requirement"; // Open the adapter with the configuration that contains the "HierarchyLevel" var target = CreateWord2007SyncAdapterWithConfiguration(conf); //Open the adapter Assert.IsTrue(target.Open(null)); // test is only useful if prerequisites are met Assert.AreNotEqual(Direction.SetInNewTfsWorkItem, CommonConfiguration.Header1.Fields.First(x => x.Name == "System.AreaPath").Direction); Assert.AreEqual(Direction.SetInNewTfsWorkItem, CommonConfiguration.Header2.Fields.First(x => x.Name == "System.AreaPath").Direction); Assert.AreEqual(Direction.SetInNewTfsWorkItem, target.WorkItems.First().Fields["System.AreaPath"].Configuration.Direction); Assert.IsTrue(target.WorkItems.First().Fields.Contains("System.GibtsNicht")); Assert.IsTrue(target.WorkItems.First().Fields.Contains("System.IterationPath")); // inherited from level 1 header }