2
// SplitDeclarationListTests.cs
5
// Mansheng Yang <lightyang0@gmail.com>
7
// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.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
27
using ICSharpCode.NRefactory.CSharp.Refactoring;
28
using NUnit.Framework;
30
namespace ICSharpCode.NRefactory.CSharp.CodeActions
33
public class SplitDeclarationListTests : ContextActionTestBase
36
public void TestLocalVariable ()
38
Test<SplitDeclarationListAction> (@"
58
public void TestField ()
60
Test<SplitDeclarationListAction> (@"
74
public void TestEvent ()
76
Test<SplitDeclarationListAction> (@"
79
event System.EventHandler $a, b, c;
83
event System.EventHandler a;
84
event System.EventHandler b;
85
event System.EventHandler c;
90
public void TestFixedField ()
92
Test<SplitDeclarationListAction> (@"
95
unsafe fixed int $a[10], b[10], c[10];
99
unsafe fixed int a[10];
100
unsafe fixed int b[10];
101
unsafe fixed int c[10];
106
public void TestVariableInFor ()
108
TestWrongContext<SplitDeclarationListAction> (@"
113
for (int a = 0, b = 0, $c = 0; a < 10; a++) {
120
public void TestSingleVariable ()
122
TestWrongContext<SplitDeclarationListAction> (@"