Skip to content

Commit

Permalink
Add delay before retrieving pet and remove debug console outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
rpothin committed Apr 3, 2024
1 parent 73a3be4 commit dae7c69
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public DataverseAPITests()
{
// Create a pet
_petId = PetHelper.CreateRandomPet(_serviceClient);

// Wait for 20 seconds
Thread.Sleep(20000);
}
}

Expand Down Expand Up @@ -115,8 +118,6 @@ public void PetPoints_DecreaseOverTime()
// Retrieve pet in initial state
Entity petInitialState = _serviceClient.Retrieve("rpo_pet", _petId, new ColumnSet("rpo_lifepoints", "rpo_happinesspoints"));

Console.WriteLine($"Initial pet id: {petInitialState.Id}");

// Wait for 3 minutes
Thread.Sleep(180000);

Expand All @@ -130,9 +131,6 @@ 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);
Assert.True(initialHappinessPoints - happinessPoints >= 20);
}
Expand Down Expand Up @@ -216,8 +214,8 @@ public void Dispose()
// Dispose managed resources.
if (_petId != Guid.Empty)
{
//PetHelper.DeletePet(_serviceClient, _petId);
//_petId = Guid.Empty;
PetHelper.DeletePet(_serviceClient, _petId);
_petId = Guid.Empty;
}

if(_serviceClient != null)
Expand Down

0 comments on commit dae7c69

Please sign in to comment.