~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to tests/UnitTests/MonoDevelop.AspNet/AspNetCompletionTests.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// 
 
2
// AspNetCompletion.cs
 
3
//  
 
4
// Author:
 
5
//       Michael Hutchinson <mhutchinson@novell.com>
 
6
// 
 
7
// Copyright (c) 2009 Novell, Inc. (http://www.novell.com)
 
8
// 
 
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:
 
15
// 
 
16
// The above copyright notice and this permission notice shall be included in
 
17
// all copies or substantial portions of the Software.
 
18
// 
 
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
 
25
// THE SOFTWARE.
 
26
 
 
27
using System;
 
28
using NUnit.Framework;
 
29
 
 
30
namespace MonoDevelop.AspNet.Tests
 
31
{
 
32
 
 
33
        [TestFixture]
 
34
        public class AspNetCompletionTests : UnitTests.TestBase
 
35
        {
 
36
                [Test]
 
37
                public void DirectiveCompletion ()
 
38
                {
 
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"));
 
44
                        
 
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"));
 
50
                        
 
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"));
 
56
                        
 
57
                        provider = AspNetTesting.CreateProvider (@"<%@$ %>", ".aspx", false);
 
58
                        Assert.IsNull (provider);
 
59
                        
 
60
                        provider = AspNetTesting.CreateProvider (@"<%@   $ %>", ".aspx", false);
 
61
                        Assert.IsNull (provider);
 
62
                }
 
63
                
 
64
                [Test]
 
65
                public void DirectiveAttributeCompletion ()
 
66
                {
 
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"));
 
72
                        
 
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"));
 
79
                        
 
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"));
 
85
                }
 
86
                
 
87
                [Test]
 
88
                [Ignore ("Not working")]
 
89
                public void DirectiveAttributeCtrlSpaceCompletion ()
 
90
                {
 
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"));
 
96
                        
 
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"));
 
103
                        
 
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"));
 
109
                }
 
110
        }
 
111
}