Skip to content

Commit

Permalink
Merge branch 'master' into new-solution-parser
Browse files Browse the repository at this point in the history
  • Loading branch information
filipw authored Jul 19, 2017
2 parents 14f50f1 + 4ed7ff3 commit 6604c56
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 36 deletions.
3 changes: 2 additions & 1 deletion NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="cli-deps" value="https://dotnet.myget.org/F/cli-deps/api/v3/index.json" />
<add key="xunit" value="https://www.myget.org/F/xunit/api/v3/index.json" />
</packageSources>
</configuration>
</configuration>
4 changes: 2 additions & 2 deletions tests/OmniSharp.DotNet.Tests/OmniSharp.DotNet.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta4-build3722" />
<PackageReference Include="xunit" Version="2.3.0-beta4-build3722" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public abstract class AbstractGetTestStartInfoFacts : AbstractTestFixture
protected const string LegacyNunitTestProject = "LegacyNunitTestProject";
protected const string LegacyMSTestProject = "LegacyMSTestProject";
protected const string XunitTestProject = "XunitTestProject";
protected const string NunitTestProject = "NunitTestProject";
protected const string NunitTestProject = "NUnitTestProject";
protected const string MSTestProject = "MSTestProject";

protected AbstractGetTestStartInfoFacts(ITestOutputHelper output)
Expand Down
2 changes: 1 addition & 1 deletion tests/OmniSharp.DotNetTest.Tests/GetTestStartInfoFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ await GetDotNetTestStartInfoAsync(
// NUnit does not work with .NET CLI RTM yet. https://github.com/nunit/dotnet-test-nunit/issues/108
// When it does, the NUnitTestProject should be updated and the tests below re-enabled.

//[Fact]
[Fact]
public async Task RunNunitTest()
{
await GetDotNetTestStartInfoAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta4-build3722" />
<PackageReference Include="xunit" Version="2.3.0-beta4-build3722" />
<PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.500-preview2-1-003177" />
</ItemGroup>

Expand Down
8 changes: 8 additions & 0 deletions tests/OmniSharp.MSBuild.Tests/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.

[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "xUnit1004:Test methods should not be skipped", Justification = "<Pending>", Scope = "member", Target = "~M:OmniSharp.MSBuild.Tests.WorkspaceInformationTests.ProjectWithSdkProperty~System.Threading.Tasks.Task")]

4 changes: 2 additions & 2 deletions tests/OmniSharp.MSBuild.Tests/OmniSharp.MSBuild.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta4-build3722" />
<PackageReference Include="xunit" Version="2.3.0-beta4-build3722" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
Expand Down
2 changes: 1 addition & 1 deletion tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public async Task TwoProjectWithGeneratedFile()
}
}

[Fact(Skip = "We're mot ready to run .NET Core SDK tests yet.")]
[Fact(Skip = "We're not ready to run .NET Core SDK tests yet.")]
public async Task ProjectWithSdkProperty()
{
using (var testProject = await TestAssets.Instance.GetTestProjectAsync("ProjectWithSdkProperty"))
Expand Down
2 changes: 1 addition & 1 deletion tests/OmniSharp.Roslyn.CSharp.Tests/DiagnosticsV2Facts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public async Task EnablesWhenEndPointIsHit(string filename1, string filename2)
var controller = new DiagnosticsService(host.Workspace, forwarder, service);
var response = await controller.Handle(new DiagnosticsRequest());

Assert.Equal(true, forwarder.IsEnabled);
Assert.True(forwarder.IsEnabled);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta4-build3722" />
<PackageReference Include="xunit" Version="2.3.0-beta4-build3722" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
Expand Down
8 changes: 4 additions & 4 deletions tests/OmniSharp.Roslyn.CSharp.Tests/SignatureHelpFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ private int Foo(string m, int n)
}";
var actual = await GetSignatureHelp(source);
Assert.Equal(3, actual.Signatures.Count());
Assert.True(actual.Signatures.ElementAt(actual.ActiveSignature).Documentation.Contains("foo2"));
Assert.Contains("foo2", actual.Signatures.ElementAt(actual.ActiveSignature).Documentation);
}

[Fact]
Expand Down Expand Up @@ -289,7 +289,7 @@ private int Foo(string m, int n)
}";
var actual = await GetSignatureHelp(source);
Assert.Equal(3, actual.Signatures.Count());
Assert.True(actual.Signatures.ElementAt(actual.ActiveSignature).Documentation.Contains("foo3"));
Assert.Contains("foo3", actual.Signatures.ElementAt(actual.ActiveSignature).Documentation);
}

[Fact]
Expand Down Expand Up @@ -319,7 +319,7 @@ private int Foo(string m, int n)
}";
var actual = await GetSignatureHelp(source);
Assert.Equal(3, actual.Signatures.Count());
Assert.True(actual.Signatures.ElementAt(actual.ActiveSignature).Documentation.Contains("foo1"));
Assert.Contains("foo1", actual.Signatures.ElementAt(actual.ActiveSignature).Documentation);
}

[Fact]
Expand Down Expand Up @@ -372,7 +372,7 @@ public Program(Program p, int n)
var actual = await GetSignatureHelp(source);
Assert.Equal(3, actual.Signatures.Count());
Assert.Equal(1, actual.ActiveParameter);
Assert.True(actual.Signatures.ElementAt(actual.ActiveSignature).Documentation.Contains("ctor2"));
Assert.Contains("ctor2", actual.Signatures.ElementAt(actual.ActiveSignature).Documentation);
}

[Fact]
Expand Down
4 changes: 2 additions & 2 deletions tests/OmniSharp.Stdio.Tests/OmniSharp.Stdio.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="2.3.0-beta2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta4-build3722" />
<PackageReference Include="xunit" Version="2.3.0-beta4-build3722" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
Expand Down
16 changes: 8 additions & 8 deletions tests/OmniSharp.Stdio.Tests/StdioServerFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ public void ServerRepliesWithResponse()
var packet = JsonConvert.DeserializeObject<ResponsePacket>(value);
Assert.Equal(request.Seq, packet.Request_seq);
Assert.Equal(request.Command, packet.Command);
Assert.Equal(true, packet.Success);
Assert.Equal(true, packet.Running);
Assert.True(packet.Success);
Assert.True(packet.Running);
Assert.Null(packet.Message);
}
);
Expand All @@ -134,14 +134,14 @@ public void ServerRepliesWithResponseWhenTaskDoesNotReturnAnything()
},
value =>
{
Assert.True(value.Contains("\"Body\":null"));
Assert.Contains("\"Body\":null", value);
// Deserialize is too relaxed...
var packet = JsonConvert.DeserializeObject<ResponsePacket>(value);
Assert.Equal(request.Seq, packet.Request_seq);
Assert.Equal(request.Command, packet.Command);
Assert.Equal(true, packet.Success);
Assert.Equal(true, packet.Running);
Assert.True(packet.Success);
Assert.True(packet.Running);
Assert.Null(packet.Message);
Assert.Null(packet.Body);
}
Expand Down Expand Up @@ -172,8 +172,8 @@ public void ServerRepliesWithResponseWhenHandlerFails()
var packet = JsonConvert.DeserializeObject<ResponsePacket>(value);
Assert.Equal(request.Seq, packet.Request_seq);
Assert.Equal(request.Command, packet.Command);
Assert.Equal(false, packet.Success);
Assert.Equal(true, packet.Running);
Assert.False(packet.Success);
Assert.True(packet.Running);
Assert.NotNull(packet.Message);
}
);
Expand All @@ -189,4 +189,4 @@ public void ServerRepliesWithResponseWhenHandlerFails()
Assert.Null(writer.Exception);
}
}
}
}
8 changes: 8 additions & 0 deletions tests/OmniSharp.Tests/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.

[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "xUnit1004:Test methods should not be skipped", Justification = "<Pending>", Scope = "member", Target = "~M:OmniSharp.Tests.UpdateBufferFilterFacts.UpdateBuffer_TransientDocumentsDisappearWhenProjectAddsThem~System.Threading.Tasks.Task")]

8 changes: 4 additions & 4 deletions tests/OmniSharp.Tests/MarkupCodeFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public void NoMarkupHasNoPositionAndNoSpans()
var markupCode = TestContent.Parse(code);

Assert.Equal("class C { }", markupCode.Code);
Assert.Equal(false, markupCode.HasPosition);
Assert.False(markupCode.HasPosition);
Assert.Throws<InvalidOperationException>(() => { var _ = markupCode.Position; });

var spans = markupCode.GetSpans();
Expand All @@ -28,7 +28,7 @@ public void PositionAtStartShouldBeZero()
var markupCode = TestContent.Parse(code);

Assert.Equal("class C { }", markupCode.Code);
Assert.Equal(true, markupCode.HasPosition);
Assert.True(markupCode.HasPosition);
Assert.Equal(0, markupCode.Position);
}

Expand All @@ -39,7 +39,7 @@ public void PositionAtEndShouldBeSameAsCodeLength()
var markupCode = TestContent.Parse(code);

Assert.Equal("class C { }", markupCode.Code);
Assert.Equal(true, markupCode.HasPosition);
Assert.True(markupCode.HasPosition);
Assert.Equal(markupCode.Code.Length, markupCode.Position);
}

Expand All @@ -50,7 +50,7 @@ public void PositionWithInterpolatedString()
var markupCode = TestContent.Parse(code);

Assert.Equal(@"class C { string s = $""Hello""; }", markupCode.Code);
Assert.Equal(true, markupCode.HasPosition);
Assert.True(markupCode.HasPosition);
Assert.Equal(21, markupCode.Position);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/OmniSharp.Tests/OmniSharp.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta4-build3722" />
<PackageReference Include="xunit" Version="2.3.0-beta4-build3722" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
Expand Down
4 changes: 2 additions & 2 deletions tests/OmniSharp.Tests/ZeroBasedIndexConverterFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public void ShouldInteractWithEmacsLikeRequests()

var input = JsonConvert.DeserializeObject<Request>(output);

Assert.Equal(input.Line, 0);
Assert.Equal(input.Column, 0);
Assert.Equal(0, input.Line);
Assert.Equal(0, input.Column);
}

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion tests/TestUtility/TestUtility.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="2.3.0-beta2" />
<PackageReference Include="Microsoft.DotNet.ProjectModel" Version="1.0.0-rc3-1-003177" />
<PackageReference Include="Microsoft.DotNet.ProjectModel.Workspaces" Version="1.0.0-preview2-1-003177" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.3.0-beta4-build3722" />
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions tests/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
<bindingRedirect oldVersion="2.0.0.0-99.0.0.0" newVersion="15.1.0.0"/>
</dependentAssembly>

<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.1.0"/>
</dependentAssembly>

<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0"/>
Expand Down

0 comments on commit 6604c56

Please sign in to comment.