Moq v3.0 Release Notes
-
- ๐ Silverlight support! Finally integrated Jason's Silverlight contribution! Issue #73
- ๐คก Brand-new simplified event raising syntax (#130):
mock.Raise(foo => foo.MyEvent += null, new MyArgs(...));
- ๐ Support for custom event signatures (not compatible with
EventHandler
):mock.Raise(foo => foo.MyEvent += null, arg1, arg2, arg3);
- ๐คก Substantially improved property setter behavior:
mock.VerifySet(foo => foo.Value = "foo");
(also available forSetupSet
- Renamed
Expect*
withSetup*
- Vastly simplified custom argument matchers:
public int IsOdd() { return Match<int>.Create(v => i % 2 == 0); }
- โ Added support for verifying how many times a member was invoked:
mock.Verify(foo => foo.Do(), Times.Never());
- โ Added simple sample app named StoreSample
- ๐ Moved Stub functionality to the core API (
SetupProperty
andSetupAllProperties
) - ๐ Fixed sample ASP.NET MVC app to work with latest version
- ๐ Allow custom matchers to be created with a substantially simpler API
- ๐ Fixed issue #145 which prevented discrimination of setups by generic method argument types
- ๐ Fixed issue #141 which prevented ref arguments matching value types (i.e. a Guid)
- ๐ Implemented improvement #131: Add support for
It.IsAny
and custom argument matchers forSetupSet
/VerifySet
- ๐ Implemented improvement #124 to render better error messages
- Applied patch from David Kirkland for improvement #125 to improve matching of enumerable parameters
- Implemented improvement #122 to provide custom errors for
Verify
- 0๏ธโฃ Implemented improvement #121 to provide
null
as default value forNullable<T>
- ๐ Fixed issue #112 which fixes passing a null argument to a mock constructor
- ๐ Implemented improvement #111 to better support params arguments
- ๐ Fixed bug #105 about improperly overwriting setups for property getter and setter
- Applied patch from Ihar.Bury for issue #99 related to protected expectations
- ๐ Fixed issue #97 on not being able to use
SetupSet
/VerifySet
if property did not have a getter - ๐ Better integration with Pex (http://research.microsoft.com/en-us/projects/Pex/)
- ๐ Various other minor fixes (#134, #135, #137, #138, #140, etc.)