Commit Graph

241 Commits

Author SHA1 Message Date
Markus Ewald
d0f0e3d2c8 Added missing comment; minor cosmetic fixes
git-svn-id: file:///srv/devel/repo-conversion/nusu@200 d2e56fa2-650e-0410-a79f-9358c0239efd
2010-07-08 12:32:41 +00:00
Markus Ewald
1ac86eebb0 Removed AssertHelper because this functionality is now integrated in NUnit
git-svn-id: file:///srv/devel/repo-conversion/nusu@199 d2e56fa2-650e-0410-a79f-9358c0239efd
2010-05-16 10:03:19 +00:00
Markus Ewald
d8d7af174a Fixed compilation error: Math.DivRem() doesn't exist in the XNA Framework for XBox 360
git-svn-id: file:///srv/devel/repo-conversion/nusu@198 d2e56fa2-650e-0410-a79f-9358c0239efd
2010-05-16 09:45:21 +00:00
Markus Ewald
a0a0b73a13 Fixed a nasty bug that would corrupt the WeakCollection upon calling RemoveDeadItems()
git-svn-id: file:///srv/devel/repo-conversion/nusu@194 d2e56fa2-650e-0410-a79f-9358c0239efd
2010-04-16 10:26:06 +00:00
Markus Ewald
f0289632f6 WeakCollection now accepts a custom EqualityComparer to be specified
git-svn-id: file:///srv/devel/repo-conversion/nusu@193 d2e56fa2-650e-0410-a79f-9358c0239efd
2010-03-30 11:02:04 +00:00
Markus Ewald
b8dbf8f40d Added an object Pool that can be used to recycle objects in order to avoid garbage buildup; wrote unit tests for the new pool class; added interface through which objects entering the pool can be instructed to revert their state
git-svn-id: file:///srv/devel/repo-conversion/nusu@192 d2e56fa2-650e-0410-a79f-9358c0239efd
2010-03-15 19:08:10 +00:00
Markus Ewald
2b94c316f6 Split Scheduler class into two files, one containing only the static time source management code (which I might decide to put somewhere else after all); added an option for users of the scheduler to query the scheduler's time source; fixed typo
git-svn-id: file:///srv/devel/repo-conversion/nusu@191 d2e56fa2-650e-0410-a79f-9358c0239efd
2010-03-03 20:47:45 +00:00
Markus Ewald
35a4da16fc Added overloads for the StringBuilderHelper.Append() method to limit the number of decimal places being displayed; wrote unit tests for the new functionality
git-svn-id: file:///srv/devel/repo-conversion/nusu@190 d2e56fa2-650e-0410-a79f-9358c0239efd
2010-02-15 19:19:26 +00:00
Markus Ewald
03eb31403d Added double precision overloads for the garbage-free string builder appending methods; the string builder helper methods for floating point values now tell whether they successfully appended a value instead of using an assertion and appending a wrong(!) value; restored full test coverage for the whole assembly
git-svn-id: file:///srv/devel/repo-conversion/nusu@189 d2e56fa2-650e-0410-a79f-9358c0239efd
2010-02-11 21:50:41 +00:00
Markus Ewald
237fb57fc8 Added an interface for the scheduler service (this might be once candidate for replacement by different implementations); added a new helper class for the StringBuilder that allows garbage-free appending of integers and floats; added unit tests for most of the code
git-svn-id: file:///srv/devel/repo-conversion/nusu@188 d2e56fa2-650e-0410-a79f-9358c0239efd
2010-02-11 21:07:04 +00:00
Markus Ewald
66f0ae9b34 The AffineThreadPool class will now work on Mono as well; fixed naming inconsistency for the EnumHelper class; inverted the counting direction used by the Semaphore class so it is easier to read (most other Semaphores count in the direction it is using now)
git-svn-id: file:///srv/devel/repo-conversion/nusu@187 d2e56fa2-650e-0410-a79f-9358c0239efd
2010-01-20 20:21:23 +00:00
Markus Ewald
11610cbbbe Added a new class, EnumHelper, which provides an implementation of Enum.GetValues() for the Xbox 360 and the GetHighestValue() and GetLowestValue() methods which can be useful if you want to create a flags array (eg. using the BitArray class) for an enumeration not declared with the [Flags] attribute or a flags enumeration not fitting within an integer or long; wrote unit tests for the new EnumHelper class, test coverage remains at 100.0%
git-svn-id: file:///srv/devel/repo-conversion/nusu@186 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-12-01 19:17:31 +00:00
Markus Ewald
52b83e8847 Added a notice that the link the code was base on appears to be dead
git-svn-id: file:///srv/devel/repo-conversion/nusu@185 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-11-17 19:42:54 +00:00
Markus Ewald
4d772fb498 Semaphore was initialized twice if its two-parameter constructor was used - fixed
git-svn-id: file:///srv/devel/repo-conversion/nusu@184 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-11-03 20:01:59 +00:00
Markus Ewald
655ae7ab10 Extended to IObservableCollection interface with an ItemsCleared event so subscribers observing the collection only to trigger 'Changed' events (versus subscribers observing the collection to wire/unwire themselves from the collection's items) can make use of the collection
git-svn-id: file:///srv/devel/repo-conversion/nusu@182 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-10-12 19:19:58 +00:00
Markus Ewald
d5293d8cb9 Made Semaphore usable on the XBox 360
git-svn-id: file:///srv/devel/repo-conversion/nusu@181 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-10-05 19:43:04 +00:00
Markus Ewald
9669adcab5 Improved documentation for the AffineThreadPool class
git-svn-id: file:///srv/devel/repo-conversion/nusu@180 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-09-27 10:48:38 +00:00
Markus Ewald
3c10f05589 Re-added the default exception handler which will now re-throw the exception, thereby mimicking the behavior of .NET's ThreadPool; wrote unit test to verify the default exception handler is working
git-svn-id: file:///srv/devel/repo-conversion/nusu@179 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-09-18 21:14:27 +00:00
Markus Ewald
273eb9885c AffineThreadPool.CpuCores is now called AffineThreadPool.Processors because this is the term used throughout the .NET framework for the same concept
git-svn-id: file:///srv/devel/repo-conversion/nusu@178 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-09-18 20:38:55 +00:00
Markus Ewald
874fe0a9e4 Found the synchronization problem in the affine thread pool - the auto reset event was being set twice before even a single thread pool thread made it through the WaitOne() - fixed by using a semaphore; implemented a semaphore that should work in the XBox 360; wrote unit tests for said semaphore; added messages to the affine thread pool's unit tests to make debugging easier
git-svn-id: file:///srv/devel/repo-conversion/nusu@177 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-09-18 20:06:09 +00:00
Markus Ewald
09247541f2 Removed the AssertionDelegate stuff and added an UnhandledException delegate to the ThreadPool - maybe I'll turn this into an event analogous to Application.ThreadException; removed the EmptyQueue method which was a flawed concept anyway (especially the disposing of state objects!); rewrote the unit tests to work with the new and improved AffineThreadPool class - there's one test that fails when run through NCover, indicating some synchronization problem that I have yet to track down!
git-svn-id: file:///srv/devel/repo-conversion/nusu@176 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-09-17 19:50:30 +00:00
Markus Ewald
7a7e71d0c3 Fixed XBox 360 compilation error
git-svn-id: file:///srv/devel/repo-conversion/nusu@175 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-09-16 20:07:36 +00:00
Markus Ewald
e74955b161 The AffineThreadPool class now also tries to create CPU-affine threads on the full .NET framework (which uses P/Invoke and tries to lock a managed thread to a system thread, probably needs some work for Mono)
git-svn-id: file:///srv/devel/repo-conversion/nusu@174 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-09-15 21:17:34 +00:00
Markus Ewald
05e4aebaac Replaced the affine thread pool with a less elegant implementation that works on the XBox 360
git-svn-id: file:///srv/devel/repo-conversion/nusu@173 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-09-15 20:03:19 +00:00
Markus Ewald
316e2c379a Added custom CPU core-affine thread pool implementation (which doesn't work on the XBox 360 because Monitor.Wait() and Monitor.Pulse() are not supported - but the code is so nice I want to capture this state in Subversion :D)
git-svn-id: file:///srv/devel/repo-conversion/nusu@172 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-09-15 19:39:08 +00:00
Markus Ewald
6ef2fdb789 Fixed a typo; fixed a bug in the plug-in library that would see generic types deriving from a required base class as suitable whereas they cannot be instantiated without a generic argument; added unit tests that reproduce the errors
git-svn-id: file:///srv/devel/repo-conversion/nusu@171 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-09-01 19:11:19 +00:00
Markus Ewald
35b1ca742d OperationQueue now attempts to prevent deep call stack nesting levels by looping when an Operation fired its AsyncEnded event synchronously; the OperationQueue's current operation index is now handled using the Interlocked methods, fixing a possible thread safety issue
git-svn-id: file:///srv/devel/repo-conversion/nusu@170 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-08-28 20:27:15 +00:00
Markus Ewald
2472c892fb Added a note about an unexplained exception that happened one time whilst executing the unit tests
git-svn-id: file:///srv/devel/repo-conversion/nusu@169 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-08-05 21:25:28 +00:00
Markus Ewald
88b89dea19 Fixed another compilation error that was causing the XBox 360 build to fail because .NET is missing the Math.DivRem() method on the XBox 360
git-svn-id: file:///srv/devel/repo-conversion/nusu@168 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-07-21 20:47:32 +00:00
Markus Ewald
d91dc70146 Fixed deque compilation error in release builds (missing #if..#endif around a place where a debug-only field was used)
git-svn-id: file:///srv/devel/repo-conversion/nusu@167 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-07-21 20:42:07 +00:00
Markus Ewald
9ec6546f70 Added out-of-sync check for the Deque enumerator; added unit test for the out-of-sync check
git-svn-id: file:///srv/devel/repo-conversion/nusu@166 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-07-14 21:52:40 +00:00
Markus Ewald
a56da772d4 Added missing CPL statements
git-svn-id: file:///srv/devel/repo-conversion/nusu@165 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-07-14 21:32:44 +00:00
Markus Ewald
0b23b1f7c4 lastBlockCount is called lastBlockEndIndex again (anyone got a better term - it's an index one past the last entry, not a count); implemented the CopyTo() method; added unit tests for the CopyTo() method
git-svn-id: file:///srv/devel/repo-conversion/nusu@164 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-07-14 21:08:10 +00:00
Markus Ewald
3ee5fdfc67 The deque class now fully supports the IList<> and IList interfaces (with the exception of CopyTo() and CopyToArray() which are not implemented yet); implemented a Clear() method; the deque enumerator is now fully functioning (but still missing an out-of-sync check); moved IndexOf() into its own file; wrote several additional unit tests to verify all the new interface methods are working and to keep test coverage at 100%
git-svn-id: file:///srv/devel/repo-conversion/nusu@163 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-07-14 20:15:34 +00:00
Markus Ewald
a817f52406 Fixed an ugly bug in the IndexOf() method; achieved 100% test coverage for the deque code so far
git-svn-id: file:///srv/devel/repo-conversion/nusu@162 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-07-13 21:17:09 +00:00
Markus Ewald
7885e86836 The deque's RemoveAt() method now shifts the objects in the direction that produces the least amount of work
git-svn-id: file:///srv/devel/repo-conversion/nusu@161 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-07-13 20:22:59 +00:00
Markus Ewald
58c3254260 Implemented more efficient Insert() method for the deque; split RemoveAt() into left-shifting and right-shifting specializations (right-shifting still is a copy of the left-shifting one, will fix it soon); improved unit tests to catch any and all border cases; made the IndexOf() method workable; wrote unit tests for the IndexOf() method; moved removal and insertion functions into the own sub-files to avoid having huge source files
git-svn-id: file:///srv/devel/repo-conversion/nusu@160 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-07-13 19:34:27 +00:00
Markus Ewald
ed62fa85f2 Implemented deque Insert() and RemoveAt() methods with fixed shifting of all items to the right for now - still have to extend the code to shift items to the closest end; added more unit tests to achieve 100% test coverage for the code
git-svn-id: file:///srv/devel/repo-conversion/nusu@159 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-07-11 19:55:59 +00:00
Markus Ewald
ff44edcdf1 Began implementing a block-allocating Deque class similar to C++'s std::deque - insertion and removal at both ends already working
git-svn-id: file:///srv/devel/repo-conversion/nusu@158 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-07-10 18:42:23 +00:00
Markus Ewald
74bf351727 Changed all remaining COMPACTFRAMEWORK constants around serialization code to NO_SERIALIZATION
git-svn-id: file:///srv/devel/repo-conversion/nusu@157 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-06-26 20:17:59 +00:00
Markus Ewald
8f16d09c8a Fixed compilation error on XBox 360
git-svn-id: file:///srv/devel/repo-conversion/nusu@156 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-06-25 19:36:18 +00:00
Markus Ewald
5d36825fc8 Attempt to fix a possible bug in the generic time source class which could potentially attempt to construct an instance of System.DateTime with an invalid tick count
git-svn-id: file:///srv/devel/repo-conversion/nusu@155 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-06-24 20:24:21 +00:00
Markus Ewald
839d46ecf1 The CommandLine class didn't construct command lines with empty arguments correctly (these need to be passed as empty quotes to be recognizable as an argument), fixed; added unit tests that exposes this bug; some minor cosmetic fixes
git-svn-id: file:///srv/devel/repo-conversion/nusu@154 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-06-24 19:20:26 +00:00
Markus Ewald
ce9a6bc932 Added a unit tests that reproduces the bug fixed in the previous commit
git-svn-id: file:///srv/devel/repo-conversion/nusu@153 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-06-22 18:54:12 +00:00
Markus Ewald
f8adca9e17 Fixed a glaring bug in the Scheduler causing errors when the scheduler's last item in the queue is cancelled
git-svn-id: file:///srv/devel/repo-conversion/nusu@152 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-06-22 18:14:45 +00:00
Markus Ewald
b38284d372 The unlimited Wait() test still didn't produce 100% coverage - somehow the thread overtook the code creating it - added a Sleep(1) to fix this...
git-svn-id: file:///srv/devel/repo-conversion/nusu@151 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-06-19 19:36:25 +00:00
Markus Ewald
128feac03e Reduced the likelihood of the unlimited wait test for the transaction class resulting in a code coverage of less than 100%
git-svn-id: file:///srv/devel/repo-conversion/nusu@150 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-06-17 21:07:34 +00:00
Markus Ewald
4fd22afcc0 Fixed two small typos
git-svn-id: file:///srv/devel/repo-conversion/nusu@149 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-06-15 20:15:43 +00:00
Markus Ewald
6d7f4d11af Minor cosmetic fix in comment
git-svn-id: file:///srv/devel/repo-conversion/nusu@148 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-06-09 19:49:55 +00:00
Markus Ewald
d6ddf04f58 On very quickly scheduled recurrent notifications, it was still possible for the wait time to become negative due to the passage of time - now the scheduler will only use the WaitOne() method when the remaining time until notification is positive
git-svn-id: file:///srv/devel/repo-conversion/nusu@147 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-06-09 19:47:30 +00:00
Markus Ewald
6b8362d57d Fixed a nasty bug that would make the scheduler queue notifications using their delay time as absolute notification time, causing negative numbers to be passed to WaitOne(); updated unit test to expose this problem if it happens
git-svn-id: file:///srv/devel/repo-conversion/nusu@146 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-06-09 19:41:38 +00:00
Markus Ewald
a6f7749121 Moved the checkForTimeAdjustment() method in the generic time source behind the WaitOne() call because that's the most likely point for a date/time adjustment will have occurred at; WindowsTimeSource now exists on the XBox 360 as well, but will throw in its constructor and report Available as false (this simplifies things in other places); Scheduler class is fully working and 100% testable with simulated time (instead of waiting for scheduled notifications to be delivered in real time, which would make testing slow); added unit tests for Scheduler class and reached 100% coverage
git-svn-id: file:///srv/devel/repo-conversion/nusu@145 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-06-09 19:28:11 +00:00
Markus Ewald
4b9002b520 Renamed DefaultTimeSource to GenericTimeSource; the generic time source will now detect when the system date/time is adjusted; made some progress on the Scheduler implementation; wrote some unit tests for the Scheduler class
git-svn-id: file:///srv/devel/repo-conversion/nusu@144 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-06-08 20:32:14 +00:00
Markus Ewald
2426868cce Improved comments in various places; disabled all classes in the 'Services' namespace, including the type listers; added scheduler class which will act sort of like the cron daemon on unix machines; defined a time source interface so I can manually advance time instead of waiting in the unit tests; created two time sources, a generic one for all platforms and a windows specific one that will notice when the system time is adjusted
git-svn-id: file:///srv/devel/repo-conversion/nusu@143 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-06-04 19:32:15 +00:00
Markus Ewald
10d6533b50 Added an obvious, simple and important optimization: when Transaction.Wait() is called, the transaction will not create a WaitHandle if it has already ended
git-svn-id: file:///srv/devel/repo-conversion/nusu@142 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-05-28 19:55:48 +00:00
Markus Ewald
0ada9998e2 Renamed AssemblyTypeLister to MultiAssemblyTypeLister because otherwise, the name implies that it's a type lister for a single assembly; renamed PredefinedTypeLister to ExplicitTypeLister which is more intuitive; disabled all service manager code unless ENABLE_SERVICEMANAGER is defined (while it's under development); improved documentation for the multi assembly type lister; removed resolveContract() delegate and generic overloads
git-svn-id: file:///srv/devel/repo-conversion/nusu@141 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-05-28 19:50:30 +00:00
Markus Ewald
c9d9810c28 Added prototype factory - a factory which created instances by cloning a prototype instance; redesigned the service manager to query types from an ITypeLister interface instead of tightly coupling it with the PluginRepository class; added type listers that list all assemblies in an app domain, in a PluginRepository and in a predefined list; renamed the IProgressTrackingService to IProgressCollectingService to make it perfectly clear which service is for which purpose; added Instancing.None to disallow the service manager from providing a certain contract; added CPL headers where they were missing
git-svn-id: file:///srv/devel/repo-conversion/nusu@140 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-05-27 19:55:06 +00:00
Markus Ewald
4e2beb71b8 Removed ConcreteType property from IAbstractFactory<> interface (it was a really strange decision to add it in the first place, luckily it hasn't crept anywhere so far); provided a non-generic abstract factory interface; the factories returned by the factory employer now implement the non-generic factory interface
git-svn-id: file:///srv/devel/repo-conversion/nusu@139 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-05-27 19:51:54 +00:00
Markus Ewald
41dcfa34d0 Added prototype code for an inversion-of-control container and a progress tracking service; moved XmlHelper class from Nuclex.UserInterface to Nuclex.Support; Nuclex.Support now uses the .NET Framework's own AssemblyLoadEventArgs class if it is compiled for the full framework; fixed a bug in the Request class that would cause exceptions to not be reported if Join() was called on a Request<x> was casted to a plain Request
git-svn-id: file:///srv/devel/repo-conversion/nusu@138 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-05-20 20:14:21 +00:00
Markus Ewald
d0fe47239e Replaced all ExpectedExceptionAttributes with the new Assert.Throws<>() method to work around a compatibility issue between TeamCity 4.5 and NUnit 2.5 Final
git-svn-id: file:///srv/devel/repo-conversion/nusu@137 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-05-07 19:36:27 +00:00
Markus Ewald
06749b9cbb Converted AssertHelperTest from using the ExpectedExceptionAttribute to Assert.Throws<>() - let's see if this makes TeamCity happy
git-svn-id: file:///srv/devel/repo-conversion/nusu@136 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-05-07 19:07:28 +00:00
Markus Ewald
d845b08a91 IObservableCollection was internal - fixed
git-svn-id: file:///srv/devel/repo-conversion/nusu@135 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-05-06 18:42:08 +00:00
Markus Ewald
7e9e0e2bf1 Made code in OperationQueue more readable; added new class PartialStream which wraps a segment of a larger stream as if it was a separate stream, allowing access to certain regions of a stream to be prohibited and headers of a stream to be cut off without requiring a lengthy copy operation
git-svn-id: file:///srv/devel/repo-conversion/nusu@134 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-05-05 19:31:05 +00:00
Markus Ewald
1c317b3f66 Moved RingMemoryStream class from the Collections namespace to the IO namespace
git-svn-id: file:///srv/devel/repo-conversion/nusu@133 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-04-28 20:44:36 +00:00
Markus Ewald
f2280629b9 The command line class can now also be used to build a command line (for example, to pass it to another program); removed dead code from the command line class
git-svn-id: file:///srv/devel/repo-conversion/nusu@132 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-04-23 20:23:23 +00:00
Markus Ewald
66b4a762cf Added a class for chaining together multiple System.IO.Stream instances into a single stream; minor improvements to docs; improved an exception error message in the StringSegment class
git-svn-id: file:///srv/devel/repo-conversion/nusu@131 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-04-22 18:55:59 +00:00
Markus Ewald
a2331b95c1 Removed the old command line parser since its replacement is fully functional by now; the CommandLine class now provides a HasArgument() method for convenience; added experimental parsing for pre-split command lines (as provided by .NET's Main() method) and disabled it because it turned out to be a bad idea
git-svn-id: file:///srv/devel/repo-conversion/nusu@130 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-04-15 19:54:01 +00:00
Markus Ewald
47b0039137 Reactivated and fixed the command line parser; command line parser now creates a value on too many option initiators (like "//test" or "---test"); renamed CommandLine.Option to CommandLine.Argument; command line parser now uses the CommandLine.Argument class for all arguments (this enables interpreters to be build that understand spaced arguments because the order is kept intact); quoted value no longer construct an argument with a raw string that doesn't contain the quotes; achieved 100% test coverage
git-svn-id: file:///srv/devel/repo-conversion/nusu@129 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-04-14 20:25:56 +00:00
Markus Ewald
6d2b39255f Updated code to match current coding guidelines
git-svn-id: file:///srv/devel/repo-conversion/nusu@128 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-04-08 19:28:31 +00:00
Markus Ewald
23c1b1587a Minor code reformat in command line parser; fixed Copy & Paste error in comments for exception unit test classes
git-svn-id: file:///srv/devel/repo-conversion/nusu@127 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-04-03 19:19:10 +00:00
Markus Ewald
46ec063abd Added missing comment
git-svn-id: file:///srv/devel/repo-conversion/nusu@126 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-04-01 21:19:09 +00:00
Markus Ewald
dcf47768e5 Fixed a bug in the Transaction class that would skip on the AsyncEnded subscriber callbacks if a subscriber unsubscribed during the callback (either in the callback thread or asynchronously at the same time); wrote a unit test that highlights the bug
git-svn-id: file:///srv/devel/repo-conversion/nusu@125 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-04-01 20:32:22 +00:00
Markus Ewald
96061c688c Added another unit test for the transaction group
git-svn-id: file:///srv/devel/repo-conversion/nusu@124 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-03-30 20:08:12 +00:00
Markus Ewald
889a47db6d Added new interface IObservableCollection which can be used to find out whether a collection can be observed, even if it is only published by its generic .NET interface
git-svn-id: file:///srv/devel/repo-conversion/nusu@123 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-03-19 19:34:11 +00:00
Markus Ewald
743fc9cc09 Fixed some typos in the comments; added weak collection which stores objects by weak reference; moved UNITTEST #if to the top of the files for some unit tests
git-svn-id: file:///srv/devel/repo-conversion/nusu@122 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-03-11 19:20:28 +00:00
Markus Ewald
190e32ee56 Fixed a serious bug in the TransactionGroup which would cause the TransactionGroup to crash when all the transactions it gets passed in the constructor were in the ended state; fixed another serious bug that would occur when transactions reached the ended state during the constructor; wrote unit tests that reproduced those bugs
git-svn-id: file:///srv/devel/repo-conversion/nusu@121 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-02-26 19:47:41 +00:00
Markus Ewald
a2f53639d4 Removed redundant 'System.' in front of an Attribute class
git-svn-id: file:///srv/devel/repo-conversion/nusu@120 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-02-18 19:21:44 +00:00
Markus Ewald
a3de5b041c Fixed some minor deviations from the coding conventions in the ProgressTracker class
git-svn-id: file:///srv/devel/repo-conversion/nusu@119 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-02-01 20:54:01 +00:00
Markus Ewald
1f1faac82a Fixed a typo
git-svn-id: file:///srv/devel/repo-conversion/nusu@118 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-01-26 20:06:41 +00:00
Markus Ewald
b90ff1c78b Added new class ObservableDictionary to the collection class library; 100% test coverage for the new ObservableDictionary class; fixed some minor issues with the code of ObservableCollection and ReadOnlyDictionary
git-svn-id: file:///srv/devel/repo-conversion/nusu@117 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-01-26 20:05:32 +00:00
Markus Ewald
2ab3b22c60 Fixed failing unit tests on Mono; used CollectionAssert.AreEquivalent() instead of CollectionAssert.AreEqual() since the order of items in a Dictionary is unspecified and Mono makes use of this allowance; fixed one serious bug that should have been caught by the .NET 2.0 unit tests: the enumeration of ReadOnlyDictionary via ICollection should return DictionaryEntry[] and not KeyValuePair<>[]
git-svn-id: file:///srv/devel/repo-conversion/nusu@115 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-01-13 20:00:13 +00:00
Markus Ewald
8dc15e8515 Upgraded Nuclex.Support to NUnit 2.5 Beta 1
git-svn-id: file:///srv/devel/repo-conversion/nusu@114 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-01-13 19:30:33 +00:00
Markus Ewald
0a483b4d44 Made Nuclex.Support compileable on the XBox 360; added new XNA 3.0 project to compile Nuclex.Support on the XBox 360; added my own AssemblyLoadEventArgs implementation since the XBox 360 XNA framework doesn't provide it; other minor fixes so Nuclex.Support can cope with the XBox 360 XNA framework
git-svn-id: file:///srv/devel/repo-conversion/nusu@113 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-01-13 18:50:52 +00:00
Markus Ewald
8f6616f79a AssertHelperTest.TestAlmostEqualWithDoubles() was testing the same code twice - fixed; made use of Assert.AreSame() instead of manually calling object.ReferenceEquals() in the SharedTest class; fixed documentation referring to the custom WeakReference as the System.WeakReference class
git-svn-id: file:///srv/devel/repo-conversion/nusu@112 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-01-08 20:14:14 +00:00
Markus Ewald
6eb49ed0d2 Updated copyright statement to include the year 2009 =); finally decided to make some of the NUnit assert helper methods public and include it in Nuclex.Support (yes, that means those methods won't be there in a build with unit testing disabled, a compromise accepted now)
git-svn-id: file:///srv/devel/repo-conversion/nusu@111 d2e56fa2-650e-0410-a79f-9358c0239efd
2009-01-07 19:05:29 +00:00
Markus Ewald
14274a9460 Added some more unit tests to verify that NextPowerOfTwo() selects the next power of two when the argument is just one increment above an even power of two
git-svn-id: file:///srv/devel/repo-conversion/nusu@110 d2e56fa2-650e-0410-a79f-9358c0239efd
2008-12-14 18:08:44 +00:00
Markus Ewald
3731fc42ae Documented what an 'ulp' is supposed to be in the FloatHelper class :)
git-svn-id: file:///srv/devel/repo-conversion/nusu@109 d2e56fa2-650e-0410-a79f-9358c0239efd
2008-12-14 18:05:14 +00:00
Markus Ewald
8923f2512a Disabled the command line parser for now to prevent anyone from using the broken code
git-svn-id: file:///srv/devel/repo-conversion/nusu@108 d2e56fa2-650e-0410-a79f-9358c0239efd
2008-12-11 20:19:29 +00:00
Markus Ewald
9c40abe10a Completed the command line parser, then decided while adding result validation to the unit tests that the parser should be greedy (and accept option initiators within option names) - I don't like the way the parser code turned out anyway, so I'll rewrite soon
git-svn-id: file:///srv/devel/repo-conversion/nusu@107 d2e56fa2-650e-0410-a79f-9358c0239efd
2008-12-11 20:15:21 +00:00
Markus Ewald
ffba112786 Wrote more unit tests for the new command line parser; actually implemented a good part of the new command line parser; wrote one more test to show that the old command line parser is broken
git-svn-id: file:///srv/devel/repo-conversion/nusu@106 d2e56fa2-650e-0410-a79f-9358c0239efd
2008-12-10 19:26:25 +00:00
Markus Ewald
f0d76f988f Disabled the old CommandLineParser; started writing a new command line parser from scratch because I didn't manage to find a sane implementation on the internet; test coverage for the whole of Nuclex.Support is now 100.0%
git-svn-id: file:///srv/devel/repo-conversion/nusu@105 d2e56fa2-650e-0410-a79f-9358c0239efd
2008-12-09 20:55:34 +00:00
Markus Ewald
447fe2aea7 Changed file name of IAbstractFactory interface to match with conventions; refactored the assembly loading code into a separate class using an interface, this allows unit testing to simulate assembly loading errors easily and might help the actual application to act on assembly load errors if so required; all classes in the Nuclex.Support.Plugins namespace now have 100% test coverage
git-svn-id: file:///srv/devel/repo-conversion/nusu@104 d2e56fa2-650e-0410-a79f-9358c0239efd
2008-12-09 19:41:43 +00:00
Markus Ewald
88b51ef0fa Eliminated warnings that still came up when compiling with the mono C# compiler; all classes in the Nuclex.Support.Scheduling namespace now have 100% test coverage
git-svn-id: file:///srv/devel/repo-conversion/nusu@103 d2e56fa2-650e-0410-a79f-9358c0239efd
2008-12-07 19:36:29 +00:00
Markus Ewald
00caebf7e9 Achieved 100% test coverage for all classes in the Nuclex.Support.Tracking namespace; wrote unit tests for the AbortedException class
git-svn-id: file:///srv/devel/repo-conversion/nusu@102 d2e56fa2-650e-0410-a79f-9358c0239efd
2008-12-07 19:01:43 +00:00
Markus Ewald
e785fdf57d Fixed a critical threading bug in the weighted transaction observation wrapper; ProgressTracker not has 100% test coverage; wrote even more unit tests for the ProgressTracker
git-svn-id: file:///srv/devel/repo-conversion/nusu@101 d2e56fa2-650e-0410-a79f-9358c0239efd
2008-12-05 19:28:39 +00:00
Markus Ewald
8c5f2d45f7 Renamed Waitable to Transaction (Progression -> Waitable -> Transaction -- might it be that this concept is no crispy enough and should be revisited? I think so!); increased test coverage for lots of classes in the tracking namespace, all but 3 are now 100% covered; eliminated redundant ProgressUpdate events from the ProgressTracker and adjusted unit tests so progress update events that re-report the current progress are optional; added a new idea for a replacement of the broken (quality-wise, at least) command line parser
git-svn-id: file:///srv/devel/repo-conversion/nusu@100 d2e56fa2-650e-0410-a79f-9358c0239efd
2008-12-03 18:58:20 +00:00
Markus Ewald
b39f8de155 Increased test coverage for the command line parser (and then decided the thing is broken beyond repair and needs a rewrite -- as if that was any surprise given the original code is from CodeProject); achieved 100% test coverage for the factory employer, instance employer, employer, no plugin attribute and abstract factory classes in the Plugins namespace; achieved some test coverage for the PluginRepository class (the uncovered sections are quite hard to stimulate since they involve exceptions during assembly load attempts)
git-svn-id: file:///srv/devel/repo-conversion/nusu@99 d2e56fa2-650e-0410-a79f-9358c0239efd
2008-11-28 19:34:43 +00:00
Markus Ewald
ecb36e9ce3 Fixed a comment in read only list sources; achieved 100% test coverage for the read only dictionary wrapper - that makes 100% test coverage for all collection classes; implemented serialization into the read only dictionary class to perfectly emulate the behavior of the .NET framework dictionary
git-svn-id: file:///srv/devel/repo-conversion/nusu@98 d2e56fa2-650e-0410-a79f-9358c0239efd
2008-11-27 20:36:51 +00:00
Markus Ewald
5c90646327 Achieved 100% test coverage for the TransformingReadOnlyCollection and ReadOnlyList classes
git-svn-id: file:///srv/devel/repo-conversion/nusu@97 d2e56fa2-650e-0410-a79f-9358c0239efd
2008-11-27 19:40:43 +00:00
Markus Ewald
195ba1df30 Reformatted the comments in the RingMemoryStream class so my favorite IDE (Visual Studio) will not destroy indentation on auto-formatting anymore; achieved 100% test coverage for the RingMemoryStream and ReverseComparer classes
git-svn-id: file:///srv/devel/repo-conversion/nusu@96 d2e56fa2-650e-0410-a79f-9358c0239efd
2008-11-27 19:04:09 +00:00