public void LinkElementHasAddressAndXlinkHrefAttribute()
		{
			XmlCompletionItemCollection expectedAttributes = new XmlCompletionItemCollection();
			expectedAttributes.Add(new XmlCompletionItem("address", XmlCompletionItemType.XmlAttribute));
			expectedAttributes.Add(new XmlCompletionItem("xlink:href", XmlCompletionItemType.XmlAttribute));
			
			Assert.AreEqual(expectedAttributes.ToArray(), linkElementAttributes.ToArray());
		}
		public void ExpectedCompletionDataItems()
		{
			XmlCompletionItemCollection expectedItems = new XmlCompletionItemCollection();
			expectedItems.Add(new XmlCompletionItem("a", XmlCompletionItemType.NamespaceUri));
			expectedItems.Add(new XmlCompletionItem("b", XmlCompletionItemType.NamespaceUri));
			expectedItems.Add(new XmlCompletionItem("c", XmlCompletionItemType.NamespaceUri));
			
			Assert.AreEqual(expectedItems.ToArray(), textEditor.CompletionItemsDisplayedToArray());
		}
Beispiel #3
0
        public void NamespaceCompletionDoesNotContainDuplicateNamespaces()
        {
            XmlCompletionItemCollection items = schemas.GetNamespaceCompletion();

            items.Sort();

            List <XmlCompletionItem> expectedItems = new List <XmlCompletionItem>();

            expectedItems.Add(new XmlCompletionItem("bar", XmlCompletionItemType.NamespaceUri));
            expectedItems.Add(new XmlCompletionItem("foo", XmlCompletionItemType.NamespaceUri));

            Assert.AreEqual(expectedItems.ToArray(), items.ToArray());
        }
Beispiel #4
0
        public void GetChildElementCompletionForDuplicateFooRootElement()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("duplicate-foo-note", "foo"));
            XmlCompletionItemCollection items = schemas.GetChildElementCompletion(path, null);

            items.Sort();

            List <XmlCompletionItem> expectedItems = new List <XmlCompletionItem>();

            expectedItems.Add(new XmlCompletionItem("duplicate-foo-text", XmlCompletionItemType.XmlElement));

            Assert.AreEqual(expectedItems.ToArray(), items.ToArray());
        }
Beispiel #5
0
        public void GetRootElementCompletionReturnsRootElementsFromBothFooSchemas()
        {
            XmlNamespaceCollection namespaces = new XmlNamespaceCollection();

            namespaces.Add(new XmlNamespace(String.Empty, "foo"));
            XmlCompletionItemCollection items = schemas.GetRootElementCompletion(namespaces);

            items.Sort();

            List <XmlCompletionItem> expectedItems = new List <XmlCompletionItem>();

            expectedItems.Add(new XmlCompletionItem("duplicate-foo-note", XmlCompletionItemType.XmlElement));
            expectedItems.Add(new XmlCompletionItem("foo-note", XmlCompletionItemType.XmlElement));

            Assert.AreEqual(expectedItems.ToArray(), items.ToArray());
        }
Beispiel #6
0
 public void CompletionItemListIsSortedAndContainsTheCorrectCompletionItems()
 {
     Assert.AreEqual(expectedCompletionItems, completionItems.ToArray());
 }
Beispiel #7
0
 public void ShouldHaveTwoNamespaceCompletionItems()
 {
     Assert.AreEqual(2, namespaceCompletionItems.ToArray().Length);
 }