public void DeterminateStepProgressNotifier_NotifyIncrementedProgress()
{
// Setup
var controller = new ConfigurableProgressController(null);
const int Steps = 11; // there are two numbers (9 and 11) for which N * (1 / N) > 1.0
var testSubject = new DeterminateStepProgressNotifier(controller, Steps);
List<Tuple<string, double>> expectedProgress = new List<Tuple<string, double>>();
// Act + Verify
for (int i = 0; i < Steps; i++)
{
int incrementedStepValue = i + 1;
double progress = incrementedStepValue == Steps ? 1.0 : (double)incrementedStepValue / Steps;
expectedProgress.Add(Tuple.Create("hello world " + i, progress));
Assert.AreEqual(i, testSubject.CurrentValue);
testSubject.NotifyIncrementedProgress(expectedProgress.Last().Item1);
Assert.AreEqual(incrementedStepValue, testSubject.CurrentValue);
controller.AssertProgressChangeEvents(expectedProgress);
}
}