Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeRobich committed May 24, 2024
1 parent 1dcb349 commit acbe1c6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions tests/OmniSharp.Cake.Tests/BlockStructureFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using OmniSharp.Cake.Services.RequestHandlers.Structure;
using OmniSharp.Models.UpdateBuffer;
using OmniSharp.Models.V2;
using Roslyn.Test.Utilities;
using TestUtility;
using Xunit;
using Xunit.Abstractions;
Expand Down Expand Up @@ -38,9 +39,11 @@ void M()[|
.ToArray();

var expected = testFile.Content.GetSpans()
.Select(span => testFile.Content.GetRangeFromSpan(span).ToRange()).ToArray();
.Select(span => testFile.Content.GetRangeFromSpan(span).ToRange())
.Reverse()
.ToArray();

Assert.Equal(expected, lineSpans);
AssertEx.Equal(expected, lineSpans);
}

private async Task<(BlockStructureResponse, TestFile)> GetResponseAsync(string code)
Expand Down
9 changes: 6 additions & 3 deletions tests/OmniSharp.Roslyn.CSharp.Tests/BlockStructureFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Threading.Tasks;
using OmniSharp.Models.V2;
using OmniSharp.Roslyn.CSharp.Services.Structure;
using Roslyn.Test.Utilities;
using TestUtility;
using Xunit;
using Xunit.Abstractions;
Expand Down Expand Up @@ -37,9 +38,11 @@ void M()[|
.ToArray();

var expected = testFile.Content.GetSpans()
.Select(span => testFile.Content.GetRangeFromSpan(span).ToRange()).ToArray();
.Select(span => testFile.Content.GetRangeFromSpan(span).ToRange())
.Reverse()
.ToArray();

Assert.Equal(expected, lineSpans);
AssertEx.Equal(expected, lineSpans);
}

[Fact]
Expand Down Expand Up @@ -89,7 +92,7 @@ private Task<BlockStructureResponse> GetResponseAsync(TestFile testFile)
FileName = testFile.FileName,
};

var requestHandler = GetRequestHandler(SharedOmniSharpTestHost);
BlockStructureService requestHandler = GetRequestHandler(SharedOmniSharpTestHost);
return requestHandler.Handle(request);
}
}
Expand Down

0 comments on commit acbe1c6

Please sign in to comment.