Skip to content

Commit

Permalink
Add OptunaTrial and Pruner to ProgressState in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hrntsm committed Dec 22, 2024
1 parent 25d2c35 commit 2d598d7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Tunny.CoreTests/Handler/ProgressStateTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
using System.Collections.Generic;

using Optuna.Trial;

using Tunny.Core.Settings;
using Tunny.Core.TEnum;

using Xunit;

namespace Tunny.Core.Handler.Tests
Expand All @@ -26,7 +31,10 @@ public void ProgressStatePropertiesTest()
BestValues = bests,
HypervolumeRatio = 0,
EstimatedTimeRemaining = new System.TimeSpan(),
IsReportOnly = false
IsReportOnly = false,
OptunaTrial = new TrialWrapper(1),
Pruner = new Pruner(),
PercentComplete = 0
};

Assert.Equal(param, progressState.Parameter);
Expand All @@ -36,6 +44,9 @@ public void ProgressStatePropertiesTest()
Assert.Equal(0, progressState.HypervolumeRatio);
Assert.Equal(new System.TimeSpan(), progressState.EstimatedTimeRemaining);
Assert.False(progressState.IsReportOnly);
Assert.Equal(1, progressState.OptunaTrial.PyObject);
Assert.Equal(PrunerType.None, progressState.Pruner.Type);
Assert.Equal(0, progressState.PercentComplete);
}

[Fact]
Expand Down

0 comments on commit 2d598d7

Please sign in to comment.