5
// Michael Hutchinson <mhutchinson@novell.com>
7
// Copyright (c) 2009 Novell, Inc. (http://www.novell.com)
9
// Permission is hereby granted, free of charge, to any person obtaining a copy
10
// of this software and associated documentation files (the "Software"), to deal
11
// in the Software without restriction, including without limitation the rights
12
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
// copies of the Software, and to permit persons to whom the Software is
14
// furnished to do so, subject to the following conditions:
16
// The above copyright notice and this permission notice shall be included in
17
// all copies or substantial portions of the Software.
19
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28
using NUnit.Framework;
30
namespace MonoDevelop.AspNet.Tests
34
public class AspNetCompletionTests : UnitTests.TestBase
37
public void DirectiveCompletion ()
39
var provider = AspNetTesting.CreateProvider (@"<%@ $ %>", ".aspx", false);
40
Assert.IsNotNull (provider);
41
Assert.AreEqual (9, provider.Count);
42
Assert.IsNotNull (provider.Find ("Page"));
43
Assert.IsNotNull (provider.Find ("Register"));
45
provider = AspNetTesting.CreateProvider (@"<%@ $ %>", ".master", false);
46
Assert.IsNotNull (provider);
47
Assert.AreEqual (7, provider.Count);
48
Assert.IsNotNull (provider.Find ("Master"));
49
Assert.IsNotNull (provider.Find ("Register"));
51
provider = AspNetTesting.CreateProvider (@"<%@ $ %>", ".ascx", false);
52
Assert.IsNotNull (provider);
53
Assert.AreEqual (7, provider.Count);
54
Assert.IsNotNull (provider.Find ("Control"));
55
Assert.IsNotNull (provider.Find ("Register"));
57
provider = AspNetTesting.CreateProvider (@"<%@$ %>", ".aspx", false);
58
Assert.IsNull (provider);
60
provider = AspNetTesting.CreateProvider (@"<%@ $ %>", ".aspx", false);
61
Assert.IsNull (provider);
65
public void DirectiveAttributeCompletion ()
67
var provider = AspNetTesting.CreateProvider (@"<%@ Page A$ %>", ".aspx", false);
68
Assert.IsNotNull (provider);
69
Assert.AreEqual (41, provider.Count);
70
Assert.IsNotNull (provider.Find ("StyleSheetTheme"));
71
Assert.IsNotNull (provider.Find ("Inherits"));
73
provider = AspNetTesting.CreateProvider (@"<%@ Master A$ %>", ".master", false);
74
Assert.IsNotNull (provider);
75
Assert.AreEqual (18, provider.Count);
76
Assert.IsNull (provider.Find ("StyleSheetTheme"));
77
Assert.IsNotNull (provider.Find ("MasterPageFile"));
78
Assert.IsNotNull (provider.Find ("Inherits"));
80
provider = AspNetTesting.CreateProvider (@"<%@ Control A$ %>", ".ascx", false);
81
Assert.IsNotNull (provider);
82
Assert.AreEqual (17, provider.Count);
83
Assert.IsNull (provider.Find ("StyleSheetTheme"));
84
Assert.IsNotNull (provider.Find ("Inherits"));
88
[Ignore ("Not working")]
89
public void DirectiveAttributeCtrlSpaceCompletion ()
91
var provider = AspNetTesting.CreateProvider (@"<%@ Page $ %>", ".aspx", true);
92
Assert.IsNotNull (provider);
93
Assert.AreEqual (41, provider.Count);
94
Assert.IsNotNull (provider.Find ("StyleSheetTheme"));
95
Assert.IsNotNull (provider.Find ("Inherits"));
97
provider = AspNetTesting.CreateProvider (@"<%@ Master $ %>", ".master", true);
98
Assert.IsNotNull (provider);
99
Assert.AreEqual (18, provider.Count);
100
Assert.IsNull (provider.Find ("StyleSheetTheme"));
101
Assert.IsNotNull (provider.Find ("MasterPageFile"));
102
Assert.IsNotNull (provider.Find ("Inherits"));
104
provider = AspNetTesting.CreateProvider (@"<%@ Control $ %>", ".ascx", true);
105
Assert.IsNotNull (provider);
106
Assert.AreEqual (17, provider.Count);
107
Assert.IsNull (provider.Find ("StyleSheetTheme"));
108
Assert.IsNotNull (provider.Find ("Inherits"));