Skip to content

Commit c5e1905

Browse files
author
slavara
committed
Merge branch 'release/2.0.0'
2 parents 90c3010 + 0705afd commit c5e1905

File tree

5 files changed

+79
-53
lines changed

5 files changed

+79
-53
lines changed

PostfixCodeCompletion.Tests/Completion/PostfixGeneratorTests.cs

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@
1111

1212
namespace PostfixCodeCompletion.Completion
1313
{
14-
[TestFixture]
1514
internal class PostfixGeneratorTests : ASCompleteTests
1615
{
17-
[TestFixture]
1816
public class GeneratorJob : PostfixGeneratorTests
1917
{
20-
[TestFixtureSetUp]
18+
[OneTimeSetUp]
2119
public void GenerateJobSetup() => TemplateUtils.Settings = new Settings();
2220

2321
static string ConvertWinNewlineToUnix(string s) => s.Replace("\r\n", "\n");
@@ -47,93 +45,93 @@ protected string Generate(string sourceText, ClassModel type, string template, s
4745
[TestFixture]
4846
public class AS3GeneratorTests : GeneratorJob
4947
{
50-
[TestFixtureSetUp]
48+
[OneTimeSetUp]
5149
public void Setup()
5250
{
5351
ASContext.Context.SetAs3Features();
5452
sci.ConfigurationLanguage = "as3";
5553
}
5654

57-
public TestCaseData GetTestCaseFromArray(string patternPath) => new TestCaseData(
55+
public static TestCaseData GetTestCaseFromArray(string patternPath) => new TestCaseData(
5856
ReadCode("BeforeGenerate_fromArray"),
5957
new ClassModel {InFile = new FileModel(), Name = "Array", Type = "Array"},
6058
ReadSnippet(patternPath),
6159
TemplateUtils.PatternCollection);
6260

63-
public TestCaseData GetTestCaseFromArrayInitializer(string patternPath) => GetTestCaseFromArrayInitializer(patternPath, TemplateUtils.PatternCollection);
64-
public TestCaseData GetTestCaseFromArrayInitializer(string patternPath, string pccpattern) => new TestCaseData(
61+
public static TestCaseData GetTestCaseFromArrayInitializer(string patternPath) => GetTestCaseFromArrayInitializer(patternPath, TemplateUtils.PatternCollection);
62+
public static TestCaseData GetTestCaseFromArrayInitializer(string patternPath, string pccpattern) => new TestCaseData(
6563
ReadCode("BeforeGenerate_fromArrayInitializer"),
6664
new ClassModel {InFile = new FileModel(), Name = "Array", Type = "Array"},
6765
ReadSnippet(patternPath),
6866
pccpattern);
6967

70-
public TestCaseData GetTestCaseFromMultilineArrayInitializer(string patternPath) => GetTestCaseFromMultilineArrayInitializer(patternPath, TemplateUtils.PatternCollection);
71-
public TestCaseData GetTestCaseFromMultilineArrayInitializer(string patternPath, string pccpattern) => new TestCaseData(
68+
public static TestCaseData GetTestCaseFromMultilineArrayInitializer(string patternPath) => GetTestCaseFromMultilineArrayInitializer(patternPath, TemplateUtils.PatternCollection);
69+
public static TestCaseData GetTestCaseFromMultilineArrayInitializer(string patternPath, string pccpattern) => new TestCaseData(
7270
ReadCode("BeforeGenerate_fromMultilineArrayInitializer"),
7371
new ClassModel {InFile = new FileModel(), Name = "Array", Type = "Array"},
7472
ReadSnippet(patternPath),
7573
pccpattern);
7674

77-
public TestCaseData GetTestCaseFromVector(string patternPath) => new TestCaseData(
75+
public static TestCaseData GetTestCaseFromVector(string patternPath) => new TestCaseData(
7876
ReadCode("BeforeGenerate_fromVector"),
7977
new ClassModel {InFile = new FileModel(), Name = "Vector.<Object>", Type = "Vector.<Object>"},
8078
ReadSnippet(patternPath),
8179
TemplateUtils.PatternCollection);
8280

83-
public TestCaseData GetTestCaseFromVectorInitializer(string patternPath) => GetTestCaseFromVectorInitializer(patternPath, TemplateUtils.PatternCollection);
84-
public TestCaseData GetTestCaseFromVectorInitializer(string patternPath, string pccpattern) => new TestCaseData(
81+
public static TestCaseData GetTestCaseFromVectorInitializer(string patternPath) => GetTestCaseFromVectorInitializer(patternPath, TemplateUtils.PatternCollection);
82+
public static TestCaseData GetTestCaseFromVectorInitializer(string patternPath, string pccpattern) => new TestCaseData(
8583
ReadCode("BeforeGenerate_fromVectorInitializer"),
8684
new ClassModel {InFile = new FileModel(), Name = "Vector.<Object>", Type = "Vector.<Object>"},
8785
ReadSnippet(patternPath),
8886
pccpattern);
8987

90-
public TestCaseData GetTestCaseFromBoolean(string patternPath) => new TestCaseData(
88+
public static TestCaseData GetTestCaseFromBoolean(string patternPath) => new TestCaseData(
9189
ReadCode("BeforeGenerate_fromBoolean"),
9290
new ClassModel {InFile = new FileModel(), Name = "Boolean", Type = "Boolean"},
9391
ReadSnippet(patternPath),
9492
TemplateUtils.PatternBool);
9593

96-
public TestCaseData GetTestCaseFromDictionary(string patternPath) => new TestCaseData(
94+
public static TestCaseData GetTestCaseFromDictionary(string patternPath) => new TestCaseData(
9795
ReadCode("BeforeGenerate_fromDictionary"),
9896
new ClassModel {InFile = new FileModel(), Name = "Dictionary", Type = "flash.utils.Dictionary"},
9997
ReadSnippet(patternPath),
10098
TemplateUtils.PatternHash);
10199

102-
public TestCaseData GetTestCaseFromUInt(string patternPath) => GetTestCaseFromUInt(patternPath, TemplateUtils.PatternHash);
103-
public TestCaseData GetTestCaseFromUInt(string patternPath, string pccpattern) => new TestCaseData(
100+
public static TestCaseData GetTestCaseFromUInt(string patternPath) => GetTestCaseFromUInt(patternPath, TemplateUtils.PatternHash);
101+
public static TestCaseData GetTestCaseFromUInt(string patternPath, string pccpattern) => new TestCaseData(
104102
ReadCode("BeforeGenerate_fromUInt"),
105103
new ClassModel {InFile = new FileModel(), Name = "Number", Type = "Number"},
106104
ReadSnippet(patternPath),
107105
pccpattern);
108106

109-
public TestCaseData GetTestCaseFromNumber(string patternPath) => GetTestCaseFromNumber(patternPath, TemplateUtils.PatternHash);
110-
public TestCaseData GetTestCaseFromNumber(string patternPath, string pccpattern) => new TestCaseData(
107+
public static TestCaseData GetTestCaseFromNumber(string patternPath) => GetTestCaseFromNumber(patternPath, TemplateUtils.PatternHash);
108+
public static TestCaseData GetTestCaseFromNumber(string patternPath, string pccpattern) => new TestCaseData(
111109
ReadCode("BeforeGenerate_fromNumber"),
112110
new ClassModel {InFile = new FileModel(), Name = "Number", Type = "Number"},
113111
ReadSnippet(patternPath),
114112
pccpattern);
115113

116-
public TestCaseData GetTestCaseFromObject(string patternPath) => new TestCaseData(
114+
public static TestCaseData GetTestCaseFromObject(string patternPath) => new TestCaseData(
117115
ReadCode("BeforeGenerate_fromObject"),
118116
new ClassModel {InFile = new FileModel(), Name = "Object", Type = "Object"},
119117
ReadSnippet(patternPath),
120118
TemplateUtils.PatternHash);
121119

122-
public TestCaseData GetTestCaseFromObjectInitializer(string patternPath) => GetTestCaseFromObjectInitializer(patternPath, TemplateUtils.PatternHash);
123-
public TestCaseData GetTestCaseFromObjectInitializer(string patternPath, string pccpattern) => new TestCaseData(
120+
public static TestCaseData GetTestCaseFromObjectInitializer(string patternPath) => GetTestCaseFromObjectInitializer(patternPath, TemplateUtils.PatternHash);
121+
public static TestCaseData GetTestCaseFromObjectInitializer(string patternPath, string pccpattern) => new TestCaseData(
124122
ReadCode("BeforeGenerate_fromObjectInitializer"),
125123
new ClassModel {InFile = new FileModel(), Name = "Object", Type = "Object"},
126124
ReadSnippet(patternPath),
127125
pccpattern);
128126

129-
public TestCaseData GetTestCaseFromString(string patternPath) => GetTestCaseFromString(patternPath, TemplateUtils.PatternString);
130-
public TestCaseData GetTestCaseFromString(string patternPath, string pccpattern) => new TestCaseData(
127+
public static TestCaseData GetTestCaseFromString(string patternPath) => GetTestCaseFromString(patternPath, TemplateUtils.PatternString);
128+
public static TestCaseData GetTestCaseFromString(string patternPath, string pccpattern) => new TestCaseData(
131129
ReadCode("BeforeGenerate_fromString"),
132130
new ClassModel {InFile = new FileModel(), Name = "String", Type = "String"},
133131
ReadSnippet(patternPath),
134132
pccpattern);
135133

136-
public IEnumerable<TestCaseData> Constructor
134+
public static IEnumerable<TestCaseData> Constructor
137135
{
138136
get
139137
{
@@ -144,7 +142,7 @@ public IEnumerable<TestCaseData> Constructor
144142
}
145143
}
146144

147-
public IEnumerable<TestCaseData> If
145+
public static IEnumerable<TestCaseData> If
148146
{
149147
get
150148
{
@@ -155,7 +153,7 @@ public IEnumerable<TestCaseData> If
155153
}
156154
}
157155

158-
public IEnumerable<TestCaseData> Else
156+
public static IEnumerable<TestCaseData> Else
159157
{
160158
get
161159
{
@@ -166,7 +164,7 @@ public IEnumerable<TestCaseData> Else
166164
}
167165
}
168166

169-
public IEnumerable<TestCaseData> Null
167+
public static IEnumerable<TestCaseData> Null
170168
{
171169
get
172170
{
@@ -177,7 +175,7 @@ public IEnumerable<TestCaseData> Null
177175
}
178176
}
179177

180-
public IEnumerable<TestCaseData> Notnull
178+
public static IEnumerable<TestCaseData> Notnull
181179
{
182180
get
183181
{
@@ -188,7 +186,7 @@ public IEnumerable<TestCaseData> Notnull
188186
}
189187
}
190188

191-
public IEnumerable<TestCaseData> Not
189+
public static IEnumerable<TestCaseData> Not
192190
{
193191
get
194192
{
@@ -199,7 +197,7 @@ public IEnumerable<TestCaseData> Not
199197
}
200198
}
201199

202-
public IEnumerable<TestCaseData> Foreach
200+
public static IEnumerable<TestCaseData> Foreach
203201
{
204202
get
205203
{
@@ -234,7 +232,7 @@ public IEnumerable<TestCaseData> Foreach
234232
}
235233
}
236234

237-
public IEnumerable<TestCaseData> Forin
235+
public static IEnumerable<TestCaseData> Forin
238236
{
239237
get
240238
{
@@ -253,7 +251,7 @@ public IEnumerable<TestCaseData> Forin
253251
}
254252
}
255253

256-
public IEnumerable<TestCaseData> For
254+
public static IEnumerable<TestCaseData> For
257255
{
258256
get
259257
{
@@ -285,7 +283,7 @@ public IEnumerable<TestCaseData> For
285283
}
286284
}
287285

288-
public IEnumerable<TestCaseData> Forr
286+
public static IEnumerable<TestCaseData> Forr
289287
{
290288
get
291289
{
@@ -309,7 +307,7 @@ public IEnumerable<TestCaseData> Forr
309307
}
310308
}
311309

312-
public IEnumerable<TestCaseData> Var
310+
public static IEnumerable<TestCaseData> Var
313311
{
314312
get
315313
{
@@ -373,7 +371,7 @@ public IEnumerable<TestCaseData> Var
373371
}
374372
}
375373

376-
public IEnumerable<TestCaseData> Const
374+
public static IEnumerable<TestCaseData> Const
377375
{
378376
get
379377
{
@@ -438,7 +436,7 @@ public IEnumerable<TestCaseData> Const
438436
}
439437
}
440438

441-
public IEnumerable<TestCaseData> New
439+
public static IEnumerable<TestCaseData> New
442440
{
443441
get
444442
{
@@ -453,7 +451,7 @@ public IEnumerable<TestCaseData> New
453451
}
454452
}
455453

456-
public IEnumerable<TestCaseData> Par
454+
public static IEnumerable<TestCaseData> Par
457455
{
458456
get
459457
{
@@ -464,7 +462,7 @@ public IEnumerable<TestCaseData> Par
464462
}
465463
}
466464

467-
public IEnumerable<TestCaseData> Return
465+
public static IEnumerable<TestCaseData> Return
468466
{
469467
get
470468
{
@@ -479,7 +477,7 @@ public IEnumerable<TestCaseData> Return
479477
}
480478
}
481479

482-
public IEnumerable<TestCaseData> While
480+
public static IEnumerable<TestCaseData> While
483481
{
484482
get
485483
{
@@ -490,7 +488,7 @@ public IEnumerable<TestCaseData> While
490488
}
491489
}
492490

493-
public IEnumerable<TestCaseData> DoWhile
491+
public static IEnumerable<TestCaseData> DoWhile
494492
{
495493
get
496494
{
@@ -501,7 +499,7 @@ public IEnumerable<TestCaseData> DoWhile
501499
}
502500
}
503501

504-
public IEnumerable<TestCaseData> Sel
502+
public static IEnumerable<TestCaseData> Sel
505503
{
506504
get
507505
{
@@ -512,7 +510,7 @@ public IEnumerable<TestCaseData> Sel
512510
}
513511
}
514512

515-
public IEnumerable<TestCaseData> Trace
513+
public static IEnumerable<TestCaseData> Trace
516514
{
517515
get
518516
{

PostfixCodeCompletion.Tests/PostfixCodeCompletion.Tests.csproj

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\..\..\..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\..\..\..\packages\NUnit.3.12.0\build\NUnit.props')" />
34
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
45
<PropertyGroup>
56
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -11,6 +12,8 @@
1112
<AssemblyName>PostfixCodeCompletion.Tests</AssemblyName>
1213
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1314
<FileAlignment>512</FileAlignment>
15+
<NuGetPackageImportStamp>
16+
</NuGetPackageImportStamp>
1417
</PropertyGroup>
1518
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1619
<DebugSymbols>true</DebugSymbols>
@@ -50,16 +53,25 @@
5053
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
5154
</PropertyGroup>
5255
<ItemGroup>
53-
<Reference Include="NSubstitute, Version=2.0.3.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL">
54-
<HintPath>..\..\..\..\packages\NSubstitute.2.0.3\lib\net40\NSubstitute.dll</HintPath>
55-
<Private>True</Private>
56+
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
57+
<HintPath>..\..\..\..\packages\Castle.Core.4.4.1\lib\net45\Castle.Core.dll</HintPath>
5658
</Reference>
57-
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
58-
<HintPath>..\..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
59-
<Private>True</Private>
59+
<Reference Include="Microsoft.CSharp" />
60+
<Reference Include="NSubstitute, Version=4.2.0.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL">
61+
<HintPath>..\..\..\..\packages\NSubstitute.4.2.2\lib\net46\NSubstitute.dll</HintPath>
62+
</Reference>
63+
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
64+
<HintPath>..\..\..\..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
6065
</Reference>
6166
<Reference Include="System" />
67+
<Reference Include="System.Configuration" />
6268
<Reference Include="System.Core" />
69+
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
70+
<HintPath>..\..\..\..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
71+
</Reference>
72+
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
73+
<HintPath>..\..\..\..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
74+
</Reference>
6375
<Reference Include="System.Windows.Forms" />
6476
</ItemGroup>
6577
<ItemGroup>
@@ -198,4 +210,10 @@
198210
</ProjectReference>
199211
</ItemGroup>
200212
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
213+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
214+
<PropertyGroup>
215+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
216+
</PropertyGroup>
217+
<Error Condition="!Exists('..\..\..\..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\NUnit.3.12.0\build\NUnit.props'))" />
218+
</Target>
201219
</Project>

PostfixCodeCompletion.Tests/app.config

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
<disableCachingBindingFailures enabled="1" />
66
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
77
<probing privatePath="Plugins" />
8+
<dependentAssembly>
9+
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
10+
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
11+
</dependentAssembly>
12+
<dependentAssembly>
13+
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
14+
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
15+
</dependentAssembly>
816
</assemblyBinding>
917
</runtime>
1018
</configuration>
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
32
<packages>
4-
<package id="NSubstitute" version="1.10.0.0" targetFramework="net35" />
5-
<package id="NUnit" version="2.6.4" targetFramework="net35" />
3+
<package id="Castle.Core" version="4.4.1" targetFramework="net48" />
4+
<package id="NSubstitute" version="4.2.2" targetFramework="net48" />
5+
<package id="NUnit" version="3.12.0" targetFramework="net48" />
6+
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net48" />
7+
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" />
68
</packages>

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
os: Visual Studio 2017
1+
os: Visual Studio 2019
22
environment:
33
ID: postfixcodecompletion
4-
PLUGIN_VERSION: 1.0
4+
PLUGIN_VERSION: 2.0
55
PLUGIN_NAME: PostfixCodeCompletion
66
PLUGIN_DESC:
77
PLUGIN_PATH: C:\projects\FlashDevelop\External\Plugins\PostfixCodeCompletion

0 commit comments

Comments
 (0)