1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
5
using System.Collections.Generic;
7
using ICSharpCode.SharpDevelop.Editor.CodeCompletion;
8
using ICSharpCode.XmlEditor;
10
using XmlEditor.Tests.Utils;
12
namespace XmlEditor.Tests.Completion
15
/// Tests that the first item in the completion list view is selected by
16
/// default. When coding in C# the default is to not select the
17
/// first item in the completion list. With XML there tends to not
18
/// be very many items in the completion list so selecting the first
19
/// one can often make editing quicker.
22
public class FirstCompletionListItemSelectedTestFixture
24
ICompletionItem selectedCompletionItem;
25
XmlCompletionItemCollection completionItems;
26
XmlSchemaCompletion defaultSchema;
29
public void SetUpFixture()
31
defaultSchema = new XmlSchemaCompletion(ResourceManager.ReadXhtmlStrictSchema());
32
completionItems = new XmlCompletionItemCollection(defaultSchema.GetRootElementCompletion());
33
selectedCompletionItem = completionItems.SuggestedItem;
37
/// Sanity check to make sure that we actually have some completion
38
/// data items from the xml completion data provider.
41
public void GeneratedCompletionItemsHasMoreThanOneItem()
43
Assert.IsTrue(completionItems.Count > 1);
47
public void SelectedCompletionItemMatchesFirstItemInCompletionList()
49
Assert.AreSame(completionItems[0], selectedCompletionItem);