You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.4 KiB
71 lines
2.4 KiB
// <file> |
|
// <copyright see="prj:///doc/copyright.txt"/> |
|
// <license see="prj:///doc/license.txt"/> |
|
// <owner name="Siegfried Pammer" email="sie_pam@gmx.at"/> |
|
// <version>$Revision$</version> |
|
// </file> |
|
|
|
using ICSharpCode.XmlEditor; |
|
using System; |
|
using NUnit.Framework; |
|
|
|
namespace ICSharpCode.XamlBinding.Tests |
|
{ |
|
[TestFixture] |
|
public class ResolveContextTests |
|
{ |
|
[Test] |
|
public void ContextNoneDescriptionTest() |
|
{ |
|
string xaml = "<Grid>\n\t<CheckBox x:Name=\"asdf\" Background=\"Aqua\" Content=\"{x:Static Cursors.Arrow}\" />\n</Grid>"; |
|
XamlContext context = CompletionDataHelper.ResolveContext(xaml, "", 2, 1); |
|
|
|
Assert.AreEqual(XamlContextDescription.None, context.Description); |
|
} |
|
|
|
[Test] |
|
public void ContextNoneDescriptionTest2() |
|
{ |
|
string xaml = "<Grid>\n\t<CheckBox x:Name=\"asdf\" Background=\"Aqua\" Content=\"{x:Static Cursors.Arrow}\" />\n</Grid>"; |
|
XamlContext context = CompletionDataHelper.ResolveContext(xaml, "", 1, 7); |
|
|
|
Assert.AreEqual(XamlContextDescription.None, context.Description); |
|
} |
|
|
|
[Test] |
|
public void ContextNoneDescriptionTest3() |
|
{ |
|
string xaml = "<Grid>\n\t<CheckBox x:Name=\"asdf\" Background=\"Aqua\" Content=\"{x:Static Cursors.Arrow}\" />\n</Grid>"; |
|
XamlContext context = CompletionDataHelper.ResolveContext(xaml, "", 3, 1); |
|
|
|
Assert.AreEqual(XamlContextDescription.None, context.Description); |
|
} |
|
|
|
[Test] |
|
public void ContextAtTagDescriptionTest() |
|
{ |
|
string xaml = "<Grid>\n\t<CheckBox x:Name=\"asdf\" Background=\"Aqua\" Content=\"{x:Static Cursors.Arrow}\" />\n</Grid>"; |
|
XamlContext context = CompletionDataHelper.ResolveContext(xaml, "", 1, 2); |
|
|
|
Assert.AreEqual(XamlContextDescription.AtTag, context.Description); |
|
} |
|
|
|
[Test] |
|
public void ContextAtTagDescriptionTest2() |
|
{ |
|
string xaml = "<Grid>\n\t<CheckBox x:Name=\"asdf\" Background=\"Aqua\" Content=\"{x:Static Cursors.Arrow}\" />\n</Grid>"; |
|
XamlContext context = CompletionDataHelper.ResolveContext(xaml, "", 2, 11); |
|
|
|
Assert.AreEqual(XamlContextDescription.AtTag, context.Description); |
|
} |
|
|
|
[Test] |
|
public void ContextInTagDescriptionTest() |
|
{ |
|
string xaml = "<Grid>\n\t<CheckBox x:Name=\"asdf\" Background=\"Aqua\" Content=\"{x:Static Cursors.Arrow}\" />\n</Grid>"; |
|
XamlContext context = CompletionDataHelper.ResolveContext(xaml, "", 2, 26); |
|
|
|
Assert.AreEqual(XamlContextDescription.InTag, context.Description); |
|
} |
|
} |
|
} |