Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
dotnet tool update dotnet-sonarscanner --tool-path ${{ runner.temp }}\scanner
- name: SonarQube Cloud scanner begin
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && env.SONAR_TOKEN != '') }}
run: ${{ runner.temp }}\scanner\dotnet-sonarscanner begin /k:"KxSystems_csharpkdb" /o:"kxsystems" /d:sonar.token="$env:SONAR_TOKEN" /d:sonar.cs.vstest.reportsPaths="**\TestResults\*.trx" /d:sonar.cs.opencover.reportsPaths="*\coverage.net8.0.opencover.xml" /d:sonar.verbose=false
run: ${{ runner.temp }}\scanner\dotnet-sonarscanner begin /k:"KxSystems_csharpkdb" /o:"kxsystems" /d:sonar.token="$env:SONAR_TOKEN" /d:sonar.cs.vstest.reportsPaths="**\TestResults\*.trx" /d:sonar.cs.opencover.reportsPaths="*\coverage.net8.0.opencover.xml" /d:sonar.verbose=false /d:sonar.exclusions="kx.Test/Scripts/GenerateLocalReport.ps1"
- name: Build
run : dotnet build /p:Configuration=Release .\CSharpKdb.sln
- name: Test .NET Framework 4.7.2
Expand Down
12 changes: 7 additions & 5 deletions kx.Test/Connection/ConnectionArrayTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ namespace kx.Test.Connection
[TestFixture]
public class ConnectionArrayTests
{
private static readonly string[] FlipKeys = {"Key_1"};
private static readonly object[] FlipValues = {new object[] { "Value_1" }};
[Test]
public void ConnectionReturnsExpectedLengthForDict()
{
const int expected = 1;

c.Dict dict = new c.Dict(new[] { "Key_1" }, new object[] { "Value_1" });
c.Dict dict = new c.Dict(FlipKeys, FlipValues);

int count = c.n(dict);

Expand All @@ -24,7 +26,7 @@ public void ConnectionReturnsExpectedLengthForFlip()
{
const int expected = 1;

c.Flip flip = new c.Flip(new c.Dict(new[] { "Key_1" }, new object[] { new object[] { "Value_1" } }));
c.Flip flip = new c.Flip(new c.Dict(FlipKeys, FlipValues));

int count = c.n(flip);

Expand Down Expand Up @@ -103,7 +105,7 @@ public void ConnectionTdThrowsIfXIsNull()
[Test]
public void ConnectionTableReturnsExpectedTableIfObjectIsFlip()
{
c.Flip flip = new c.Flip(new c.Dict(new[] { "Key_1" }, new object[] { new object[] { "Value_1" } }));
c.Flip flip = new c.Flip(new c.Dict(FlipKeys, FlipValues));

object result = c.td(flip);

Expand All @@ -116,8 +118,8 @@ public void ConnectionTableReturnsExpectedTableIfObjectIsDict()
{
c.Dict dict = new c.Dict
(
new c.Flip(new c.Dict(new[] { "Key_1" }, new object[] { new object[] { "Value_1" } })),
new c.Flip(new c.Dict(new[] { "Key_1" }, new object[] { new object[] { "Value_1" } }))
new c.Flip(new c.Dict(FlipKeys, FlipValues)),
new c.Flip(new c.Dict(FlipKeys, FlipValues))
);

object result = c.td(dict);
Expand Down
4 changes: 2 additions & 2 deletions kx.Test/Connection/ConnectionNullTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -646,15 +646,15 @@ public void ConnectionIsQNullReturnsFalseForTimeSpanArray()
[Test]
public void ConnectionIsQNullReturnsFalseForDict()
{
c.Dict input = new c.Dict(new string[] { }, new object[] { });
c.Dict input = new c.Dict(Array.Empty<string>(), Array.Empty<object>());

Assert.IsFalse(c.qn(input));
}

[Test]
public void ConnectionIsQNullReturnsFalseForFlip()
{
c.Flip input = new c.Flip(new c.Dict(new string[] { }, new object[] { }));
c.Flip input = new c.Flip(new c.Dict(Array.Empty<string>(), Array.Empty<object>()));

Assert.IsFalse(c.qn(input));
}
Expand Down
Loading