Skip to content

Commit

Permalink
Fix pet life points and happiness points calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
rpothin committed Apr 3, 2024
1 parent 8042910 commit 4f8512d
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,13 @@ public void PetPoints_DecreaseOverTime()
var happinessPoints = pet.GetAttributeValue<int>("rpo_happinesspoints");

// Check if the lifepoints and happinesspoints have decreased by at least 20 points
Console.WriteLine($"Initial life points: {initialLifePoints}, Current life points: {lifePoints}");
Console.WriteLine($"Initial happiness points: {initialHappinessPoints}, Current happiness points: {happinessPoints}");

Assert.True(initialLifePoints - lifePoints >= 20);

Check failure on line 131 in src/Dataverse.API.Testing/VirtualPetSimulator.Testing/VirtualPetsSimulator.cs

View workflow job for this annotation

GitHub Actions / Dataverse API Testing

Dataverse.API.Testing.DataverseAPITests ► PetPoints_DecreaseOverTime

Failed test found in: src/Dataverse.API.Testing/VirtualPetSimulator.Testing/TestResults/test-results.trx Error: Assert.True() Failure Expected: True Actual: False
Raw output
Assert.True() Failure
Expected: True
Actual:   False
   at Dataverse.API.Testing.DataverseAPITests.PetPoints_DecreaseOverTime() in /home/runner/work/PowerPlatform-DevEx-With-GitHub-Workshop/PowerPlatform-DevEx-With-GitHub-Workshop/src/Dataverse.API.Testing/VirtualPetSimulator.Testing/VirtualPetsSimulator.cs:line 131
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
Assert.True(initialHappinessPoints - happinessPoints >= 20);
}

/*
/// <summary>
/// Tests the feeding of a pet entity.
/// </summary>
Expand Down Expand Up @@ -196,7 +199,7 @@ public void FeedPet_ReachingInitialLifePoints()
// Assert
Assert.True(PetHelper.ArePetLifePointsCorrectlyUpdatedAfterFeedingActivity(_serviceClient, _petId, initialLifePoints, selectedFoodQuantity));
}

*/
/// <summary>
/// Disposes the resources used by the <see cref="DataverseAPITests"/> class.
/// </summary>
Expand Down

0 comments on commit 4f8512d

Please sign in to comment.