Skip to content

Commit

Permalink
Merge branch 'refs/heads/dev' into feat/AP-177-failing-goal-structures
Browse files Browse the repository at this point in the history
# Conflicts:
#	Aplib.Core.Tests/Desire/GoalTests.cs
  • Loading branch information
LukaBerkers committed Jun 17, 2024
2 parents 81ad25e + a58c47c commit cd781ce
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
distribution: 'zulu'
- uses: actions/checkout@v4
with:
fetch-depth: 1
fetch-depth: 0
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -199,4 +199,4 @@ jobs:
name: nuget-package
path: bin
- name: Upload NuGet Package to NuGet.org
run: dotnet nuget push bin/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
run: dotnet nuget push bin/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
distribution: 'zulu'
- uses: actions/checkout@v4
with:
fetch-depth: 1
fetch-depth: 0
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -64,4 +64,4 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
8 changes: 5 additions & 3 deletions Aplib.Core.Tests/Desire/GoalTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Aplib.Core.Tests.Tools;
using FluentAssertions;
using Moq;
using System.Diagnostics.CodeAnalysis;

namespace Aplib.Core.Tests.Desire;

Expand Down Expand Up @@ -121,12 +122,12 @@ public void Goal_WhereEvaluationIsPerformed_DoesNotInfluenceBelieveSet()
/// the most recent heuristics are used
/// </summary>
[Fact]
[SuppressMessage("ReSharper", "AccessToModifiedClosure")]
public void Goal_WhereHeuristicsChange_UsesUpdatedHeuristics()
{
// Arrange
IBeliefSet beliefSetMock = Mock.Of<IBeliefSet>();
bool shouldSucceed = false;
// ReSharper disable once AccessToModifiedClosure
Goal<IBeliefSet> goal = new TestGoalBuilder().WithHeuristicFunction(_ => shouldSucceed).Build();

// Act
Expand Down Expand Up @@ -155,8 +156,6 @@ public void GoalConstructor_WhereHeuristicFunctionTypeDiffers_HasEqualBehaviour(
// Arrange
ITactic<IBeliefSet> tactic = Mock.Of<ITactic<IBeliefSet>>();

// ReSharper disable once MoveLocalFunctionAfterJumpStatement
bool HeuristicFunctionBoolean(IBeliefSet _) => goalCompleted;
Goal<IBeliefSet>.HeuristicFunction heuristicFunctionNonBoolean =
CommonHeuristicFunctions<IBeliefSet>.Boolean(_ => goalCompleted);

Expand All @@ -171,6 +170,9 @@ public void GoalConstructor_WhereHeuristicFunctionTypeDiffers_HasEqualBehaviour(

// Assert
goalBooleanEvaluation.Should().Be(goalNonBooleanEvaluation);
return;

bool HeuristicFunctionBoolean(IBeliefSet _) => goalCompleted;
}

[Fact]
Expand Down

0 comments on commit cd781ce

Please sign in to comment.