Used pragmas to avoid warnings in unit tests designed to test obsolete methods; method thread-related classes into a new namespace, 'Threading'
git-svn-id: file:///srv/devel/repo-conversion/nusu@331 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
parent
a934fb155e
commit
e6e0220fb3
7 changed files with 32 additions and 22 deletions
|
@ -47,7 +47,9 @@ namespace Nuclex.Support {
|
|||
|
||||
/// <summary>Fires the property changed event for the 'SomePropety' property</summary>
|
||||
public void FireSomePropertyChanged() {
|
||||
#pragma warning disable 0618
|
||||
OnPropertyChanged(() => SomeProperty);
|
||||
#pragma warning restore 0618
|
||||
}
|
||||
|
||||
/// <summary>Example property that will be reported to have changed</summary>
|
||||
|
|
|
@ -50,7 +50,9 @@ namespace Nuclex.Support {
|
|||
[Test]
|
||||
public void MatchingPropertyChangeNotificationIsRecognized() {
|
||||
var arguments = new PropertyChangedEventArgs("SomeProperty");
|
||||
#pragma warning disable 0618
|
||||
Assert.IsTrue(arguments.AreAffecting(() => ViewModel.SomeProperty));
|
||||
#pragma warning restore 0618
|
||||
Assert.IsTrue(arguments.AreAffecting("SomeProperty"));
|
||||
}
|
||||
|
||||
|
@ -61,7 +63,9 @@ namespace Nuclex.Support {
|
|||
[Test]
|
||||
public void MismatchingPropertyIsReportedAsUnaffected() {
|
||||
var arguments = new PropertyChangedEventArgs("AnotherProperty");
|
||||
#pragma warning disable 0618
|
||||
Assert.IsFalse(arguments.AreAffecting(() => ViewModel.SomeProperty));
|
||||
#pragma warning restore 0618
|
||||
Assert.IsFalse(arguments.AreAffecting("SomeProperty"));
|
||||
}
|
||||
|
||||
|
@ -72,7 +76,9 @@ namespace Nuclex.Support {
|
|||
[Test]
|
||||
public void SpecificPropertyIsAffectedByNullWildcard() {
|
||||
var nullArguments = new PropertyChangedEventArgs(null);
|
||||
#pragma warning disable 0618
|
||||
Assert.IsTrue(nullArguments.AreAffecting(() => ViewModel.SomeProperty));
|
||||
#pragma warning restore 0618
|
||||
Assert.IsTrue(nullArguments.AreAffecting("SomeProperty"));
|
||||
}
|
||||
|
||||
|
@ -83,7 +89,9 @@ namespace Nuclex.Support {
|
|||
[Test]
|
||||
public void SpecificPropertyIsAffectedByEmptyWildcard() {
|
||||
var emptyArguments = new PropertyChangedEventArgs(string.Empty);
|
||||
#pragma warning disable 0618
|
||||
Assert.IsTrue(emptyArguments.AreAffecting(() => ViewModel.SomeProperty));
|
||||
#pragma warning disable 0618
|
||||
Assert.IsTrue(emptyArguments.AreAffecting("SomeProperty"));
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ using System.Threading;
|
|||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Nuclex.Support {
|
||||
namespace Nuclex.Support.Threading {
|
||||
|
||||
/// <summary>Unit Test for the CPU core-affine thread pool</summary>
|
||||
[TestFixture]
|
||||
|
@ -351,6 +351,6 @@ namespace Nuclex.Support {
|
|||
|
||||
}
|
||||
|
||||
} // namespace Nuclex.Support
|
||||
} // namespace Nuclex.Support.Threading
|
||||
|
||||
#endif // UNITTEST
|
|
@ -24,7 +24,7 @@ using System.Diagnostics;
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
|
||||
namespace Nuclex.Support {
|
||||
namespace Nuclex.Support.Threading {
|
||||
|
||||
/// <summary>Alternative Thread pool providing one thread for each core</summary>
|
||||
/// <remarks>
|
||||
|
@ -293,4 +293,4 @@ namespace Nuclex.Support {
|
|||
|
||||
}
|
||||
|
||||
} // namespace Nuclex.Support
|
||||
} // namespace Nuclex.Support.Threading
|
|
@ -28,7 +28,7 @@ using System.Collections.Generic;
|
|||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Nuclex.Support {
|
||||
namespace Nuclex.Support.Threading {
|
||||
|
||||
/// <summary>Unit Test for the parallel background worker class</summary>
|
||||
[TestFixture]
|
||||
|
@ -249,7 +249,7 @@ namespace Nuclex.Support {
|
|||
|
||||
}
|
||||
|
||||
} // namespace Nuclex.Support
|
||||
} // namespace Nuclex.Support.Threading
|
||||
|
||||
#endif // UNITTEST
|
||||
|
|
@ -26,7 +26,7 @@ using System.Collections.Generic;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Nuclex.Support {
|
||||
namespace Nuclex.Support.Threading {
|
||||
|
||||
/// <summary>Processes tasks in parallel using many threads</summary>
|
||||
/// <typeparam name="TTask">Type of tasks the class will process</typeparam>
|
||||
|
@ -339,6 +339,6 @@ namespace Nuclex.Support {
|
|||
|
||||
}
|
||||
|
||||
} // namespace Nuclex.Support
|
||||
} // namespace Nuclex.Support.Threading
|
||||
|
||||
#endif // !NO_CONCURRENT_COLLECTIONS
|
Loading…
Add table
Add a link
Reference in a new issue