Fixed errors introduced into the unit tests by the lengthy rename operation earlier this day
git-svn-id: file:///srv/devel/repo-conversion/nusu@68 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
parent
8ef451a731
commit
26cb8c08af
|
@ -29,11 +29,11 @@ namespace Nuclex.Support.Scheduling {
|
||||||
/// <typeparam name="OperationType">
|
/// <typeparam name="OperationType">
|
||||||
/// Type of the child operations the QueueOperation will contain
|
/// Type of the child operations the QueueOperation will contain
|
||||||
/// </typeparam>
|
/// </typeparam>
|
||||||
public class QueueOperation<OperationType> : Operation
|
public class QueueOperation<OperationType> : Operation, IProgressReporter
|
||||||
where OperationType : Operation {
|
where OperationType : Operation {
|
||||||
|
|
||||||
/// <summary>will be triggered to report when progress has been achieved</summary>
|
/// <summary>will be triggered to report when progress has been achieved</summary>
|
||||||
public event EventHandler<ProgressReportEventArgs> AsyncProgressUpdated;
|
public event EventHandler<ProgressReportEventArgs> AsyncProgressChanged;
|
||||||
|
|
||||||
/// <summary>Initializes a new queue operation with default weights</summary>
|
/// <summary>Initializes a new queue operation with default weights</summary>
|
||||||
/// <param name="childs">Child operations to execute in this operation</param>
|
/// <param name="childs">Child operations to execute in this operation</param>
|
||||||
|
@ -114,7 +114,7 @@ namespace Nuclex.Support.Scheduling {
|
||||||
/// Progression's ProgressUpdateEventArgs class.
|
/// Progression's ProgressUpdateEventArgs class.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected virtual void OnAsyncProgressChanged(ProgressReportEventArgs eventArguments) {
|
protected virtual void OnAsyncProgressChanged(ProgressReportEventArgs eventArguments) {
|
||||||
EventHandler<ProgressReportEventArgs> copy = AsyncProgressUpdated;
|
EventHandler<ProgressReportEventArgs> copy = AsyncProgressChanged;
|
||||||
if(copy != null)
|
if(copy != null)
|
||||||
copy(this, eventArguments);
|
copy(this, eventArguments);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace Nuclex.Support.Tracking {
|
||||||
/// <summary>Called when the progression tracker's progress changes</summary>
|
/// <summary>Called when the progression tracker's progress changes</summary>
|
||||||
/// <param name="sender">Progression tracker whose progress has changed</param>
|
/// <param name="sender">Progression tracker whose progress has changed</param>
|
||||||
/// <param name="e">Contains the new progress achieved</param>
|
/// <param name="e">Contains the new progress achieved</param>
|
||||||
void ProgressUpdated(object sender, ProgressReportEventArgs e);
|
void ProgressChanged(object sender, ProgressReportEventArgs e);
|
||||||
|
|
||||||
/// <summary>Called when the progression tracker's idle state changes</summary>
|
/// <summary>Called when the progression tracker's idle state changes</summary>
|
||||||
/// <param name="sender">Progression tracker whose idle state has changed</param>
|
/// <param name="sender">Progression tracker whose idle state has changed</param>
|
||||||
|
@ -55,11 +55,11 @@ namespace Nuclex.Support.Tracking {
|
||||||
#region class ProgressUpdateEventArgsMatcher
|
#region class ProgressUpdateEventArgsMatcher
|
||||||
|
|
||||||
/// <summary>Compares two ProgressUpdateEventArgsInstances for NMock validation</summary>
|
/// <summary>Compares two ProgressUpdateEventArgsInstances for NMock validation</summary>
|
||||||
private class ProgressUpdateEventArgsMatcher : Matcher {
|
private class ProgressReportEventArgsMatcher : Matcher {
|
||||||
|
|
||||||
/// <summary>Initializes a new ProgressUpdateEventArgsMatcher </summary>
|
/// <summary>Initializes a new ProgressUpdateEventArgsMatcher </summary>
|
||||||
/// <param name="expected">Expected progress update event arguments</param>
|
/// <param name="expected">Expected progress update event arguments</param>
|
||||||
public ProgressUpdateEventArgsMatcher(ProgressReportEventArgs expected) {
|
public ProgressReportEventArgsMatcher(ProgressReportEventArgs expected) {
|
||||||
this.expected = expected;
|
this.expected = expected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ namespace Nuclex.Support.Tracking {
|
||||||
#region class TestProgression
|
#region class TestProgression
|
||||||
|
|
||||||
/// <summary>Progression used for testing in this unit test</summary>
|
/// <summary>Progression used for testing in this unit test</summary>
|
||||||
private class TestProgression : Waitable {
|
private class TestProgression : Waitable, IProgressReporter {
|
||||||
|
|
||||||
/// <summary>will be triggered to report when progress has been achieved</summary>
|
/// <summary>will be triggered to report when progress has been achieved</summary>
|
||||||
public event EventHandler<ProgressReportEventArgs> AsyncProgressChanged;
|
public event EventHandler<ProgressReportEventArgs> AsyncProgressChanged;
|
||||||
|
@ -157,11 +157,11 @@ namespace Nuclex.Support.Tracking {
|
||||||
WithAnyArguments();
|
WithAnyArguments();
|
||||||
|
|
||||||
Expect.Exactly(2).On(mockedSubscriber).
|
Expect.Exactly(2).On(mockedSubscriber).
|
||||||
Method("ProgressUpdated").
|
Method("ProgressChanged").
|
||||||
With(
|
With(
|
||||||
new Matcher[] {
|
new Matcher[] {
|
||||||
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
||||||
new ProgressUpdateEventArgsMatcher(new ProgressReportEventArgs(0.0f))
|
new ProgressReportEventArgsMatcher(new ProgressReportEventArgs(0.0f))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -171,11 +171,11 @@ namespace Nuclex.Support.Tracking {
|
||||||
tracker.Track(test2);
|
tracker.Track(test2);
|
||||||
|
|
||||||
Expect.Once.On(mockedSubscriber).
|
Expect.Once.On(mockedSubscriber).
|
||||||
Method("ProgressUpdated").
|
Method("ProgressChanged").
|
||||||
With(
|
With(
|
||||||
new Matcher[] {
|
new Matcher[] {
|
||||||
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
||||||
new ProgressUpdateEventArgsMatcher(new ProgressReportEventArgs(0.25f))
|
new ProgressReportEventArgsMatcher(new ProgressReportEventArgs(0.25f))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -203,11 +203,11 @@ namespace Nuclex.Support.Tracking {
|
||||||
WithAnyArguments();
|
WithAnyArguments();
|
||||||
|
|
||||||
Expect.Exactly(2).On(mockedSubscriber).
|
Expect.Exactly(2).On(mockedSubscriber).
|
||||||
Method("ProgressUpdated").
|
Method("ProgressChanged").
|
||||||
With(
|
With(
|
||||||
new Matcher[] {
|
new Matcher[] {
|
||||||
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
||||||
new ProgressUpdateEventArgsMatcher(new ProgressReportEventArgs(0.0f))
|
new ProgressReportEventArgsMatcher(new ProgressReportEventArgs(0.0f))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -217,22 +217,22 @@ namespace Nuclex.Support.Tracking {
|
||||||
tracker.Track(test2);
|
tracker.Track(test2);
|
||||||
|
|
||||||
Expect.Once.On(mockedSubscriber).
|
Expect.Once.On(mockedSubscriber).
|
||||||
Method("ProgressUpdated").
|
Method("ProgressChanged").
|
||||||
With(
|
With(
|
||||||
new Matcher[] {
|
new Matcher[] {
|
||||||
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
||||||
new ProgressUpdateEventArgsMatcher(new ProgressReportEventArgs(0.25f))
|
new ProgressReportEventArgsMatcher(new ProgressReportEventArgs(0.25f))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
test1.ChangeProgress(0.5f);
|
test1.ChangeProgress(0.5f);
|
||||||
|
|
||||||
Expect.Once.On(mockedSubscriber).
|
Expect.Once.On(mockedSubscriber).
|
||||||
Method("ProgressUpdated").
|
Method("ProgressChanged").
|
||||||
With(
|
With(
|
||||||
new Matcher[] {
|
new Matcher[] {
|
||||||
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
||||||
new ProgressUpdateEventArgsMatcher(new ProgressReportEventArgs(0.75f))
|
new ProgressReportEventArgsMatcher(new ProgressReportEventArgs(0.75f))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -242,11 +242,11 @@ namespace Nuclex.Support.Tracking {
|
||||||
test2.End();
|
test2.End();
|
||||||
|
|
||||||
Expect.Once.On(mockedSubscriber).
|
Expect.Once.On(mockedSubscriber).
|
||||||
Method("ProgressUpdated").
|
Method("ProgressChanged").
|
||||||
With(
|
With(
|
||||||
new Matcher[] {
|
new Matcher[] {
|
||||||
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
||||||
new ProgressUpdateEventArgsMatcher(new ProgressReportEventArgs(1.0f))
|
new ProgressReportEventArgsMatcher(new ProgressReportEventArgs(1.0f))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -289,11 +289,11 @@ namespace Nuclex.Support.Tracking {
|
||||||
WithAnyArguments();
|
WithAnyArguments();
|
||||||
|
|
||||||
Expect.Once.On(mockedSubscriber).
|
Expect.Once.On(mockedSubscriber).
|
||||||
Method("ProgressUpdated").
|
Method("ProgressChanged").
|
||||||
With(
|
With(
|
||||||
new Matcher[] {
|
new Matcher[] {
|
||||||
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
||||||
new ProgressUpdateEventArgsMatcher(new ProgressReportEventArgs(0.0f))
|
new ProgressReportEventArgsMatcher(new ProgressReportEventArgs(0.0f))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -301,22 +301,22 @@ namespace Nuclex.Support.Tracking {
|
||||||
tracker.Track(test1);
|
tracker.Track(test1);
|
||||||
|
|
||||||
Expect.Once.On(mockedSubscriber).
|
Expect.Once.On(mockedSubscriber).
|
||||||
Method("ProgressUpdated").
|
Method("ProgressChanged").
|
||||||
With(
|
With(
|
||||||
new Matcher[] {
|
new Matcher[] {
|
||||||
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
||||||
new ProgressUpdateEventArgsMatcher(new ProgressReportEventArgs(0.5f))
|
new ProgressReportEventArgsMatcher(new ProgressReportEventArgs(0.5f))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
tracker.Track(Waitable.EndedDummy);
|
tracker.Track(Waitable.EndedDummy);
|
||||||
|
|
||||||
Expect.Once.On(mockedSubscriber).
|
Expect.Once.On(mockedSubscriber).
|
||||||
Method("ProgressUpdated").
|
Method("ProgressChanged").
|
||||||
With(
|
With(
|
||||||
new Matcher[] {
|
new Matcher[] {
|
||||||
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
new NMock2.Matchers.TypeMatcher(typeof(ProgressTracker)),
|
||||||
new ProgressUpdateEventArgsMatcher(new ProgressReportEventArgs(1.0f))
|
new ProgressReportEventArgsMatcher(new ProgressReportEventArgs(1.0f))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -359,7 +359,7 @@ namespace Nuclex.Support.Tracking {
|
||||||
new EventHandler<IdleStateEventArgs>(mockedSubscriber.IdleStateChanged);
|
new EventHandler<IdleStateEventArgs>(mockedSubscriber.IdleStateChanged);
|
||||||
|
|
||||||
tracker.AsyncProgressChanged +=
|
tracker.AsyncProgressChanged +=
|
||||||
new EventHandler<ProgressReportEventArgs>(mockedSubscriber.ProgressUpdated);
|
new EventHandler<ProgressReportEventArgs>(mockedSubscriber.ProgressChanged);
|
||||||
|
|
||||||
return mockedSubscriber;
|
return mockedSubscriber;
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,7 +220,7 @@ namespace Nuclex.Support.Tracking {
|
||||||
ISetProgressionSubscriber mockedSubscriber = mockSubscriber(testSetProgression);
|
ISetProgressionSubscriber mockedSubscriber = mockSubscriber(testSetProgression);
|
||||||
|
|
||||||
Expect.Exactly(2).On(mockedSubscriber).
|
Expect.Exactly(2).On(mockedSubscriber).
|
||||||
Method("ProgressUpdated").
|
Method("ProgressChanged").
|
||||||
WithAnyArguments();
|
WithAnyArguments();
|
||||||
|
|
||||||
Expect.Once.On(mockedSubscriber).
|
Expect.Once.On(mockedSubscriber).
|
||||||
|
|
Loading…
Reference in New Issue
Block a user