All Versions
107
Latest Version
Avg Release Cycle
40 days
Latest Release
425 days ago
Changelog History
Page 10
Changelog History
Page 10
-
v4.1.1309.800 Changes
September 08, 2013๐ This version was released twice under different version numbers.
โ Added
- ๐ New
It.IsNotNull<T>
matcher (@Pjanssen, #40) - โ Add covariant
IMock<out T>
interface toMock<T>
(@tkellogg, #44)
๐ Changed
- ๐ Rename
Changelog.txt
toReleaseNotes.md
and inject the latter into the NuGet metadata (@Moq, #52)
๐ Fixed
- ๐ Fix "collection modified" exception thrown as result of more methods being called on a mock while verifying method calls (@yonahw, #36)
- ๐ Fix
NullReferenceException
when subscribing to an event (@bittailor, #39) - ๐ Fix thread safety issue (
IndexOutOfRangeException
) on setup (@stoo101, #51)
- ๐ New
-
v4.1.1309.1617 Changes
September 16, 2013๐ This version was released twice under different version numbers.
๐ Fixed
- ๐ Fix regression bug surrounding
Mock.As<TInterface>()
: Prevent early initialization of mock from checking for delegate mocks. (@kzu, #54)
- ๐ Fix regression bug surrounding
-
v4.1.1308.2316 Changes
๐ Minor change only (change title in NuGet package metadata)
-
v4.1.1308.2120 Changes
โ Added
- โ Add capability for mocking delegates (event handlers) (@quetzalcoatl, #4)
- ๐ Allow
CallBase
for specific method / property (@srudin, #8) - ๐ New matchers
It.IsIn
andIt.IsNotIn
(@rdingwall, #27) - โ Add
.gitignore
file (@yorah, #10 / @FellicePollano, #30) - โ Add new
Verify
method overload group that accepts aTimes
instance (@ChrisMissal, #34)
๐ Changed
- โก๏ธ Update Castle.Core assemblies from version 1.2.0.0 to 3.2.0, fetch Castle.Core via NuGet (@yorah, #11 / @kzu)
- Corrected Verify method behavior for generic methods calls (@Suremaker, #25)
- Split up
Interceptor.Intercept
into a set of 8 strategies, introduceInterceptionAction
(@FellicePollano, #31)
๐ Fixed
- ๐ Fix
SetupSequentialContext
to increment counter also afterThrows
(@lukas-ais, #7) - ๐คก Make
Mock.Of
work on properties with non-public setters (@yorah, #9, #19) - โ Adding (and removing) handlers for events declared on interfaces when
CallBase = true
(@IharBury, #13) - ๐คก Distinguish between verification exception and mock crash (@quetzalcoatl, #16)
- ๐ Improve thread safety of
Interceptor
class (@FelicePollano, #29)
Note: Release notes in the above format are not available for ealier versions of Moq. The above ๐ changelog entries have been reconstructed from the Git commit history. What follows below are the ๐ original release notes, for which maintenance stopped around Moq version 4.5. They are nevertheless included below as they go back further in time.
-
v4.1 Changes
- โ Added covariant
IMock<out T>
interface toMock<T>
- โ Added
It.IsNotNull<T>
- ๐ Fix: 'NullReferenceException when subscribing to an event'
- โ Added overloads to
Verify
to acceptTimes
as a Method Group - ๐ Feature request:
It.IsIn(..)
,It.IsNotIn(...)
- Corrected Verify method behavior for generic methods calls
- ๐คก Differentiate verification error from mock crash
- ๐ Fix: Adding (and removing) handlers for events declared on interfaces works when
CallBase = true
. - โก๏ธ Update to latest Castle
- ๐ Fix:
Mock.Of
(Functional Syntax) doesn't work on properties with non-public setters - ๐ Fix: Allow to use
CallBase
instead ofReturns
- ๐ Fix: Solved Multi-threading issue -
IndexOutOfRangeException
- ๐คก Capability of mocking delegates (event handlers)
- โ Added covariant
-
v4.0 Changes
- ๐คก Linq to Mocks:
Mock.Of<T>(x => x.Id == 23 && x.Title == "Rocks!")
- ๐ Fixed issues:
- 87
BadImageFormatException
when using a mock with a Visual Studio generated Accessor object - 166 Unable to use a delegate to mock a function that takes 5 or more parameters.
- 168 Call count failure message never says which is the actual invocation count
- 175
theMock.Object
failing on VS2010 Beta 1 - 177 Generic constraint on interface method causes
BadImageFormatException
when gettingObject
. - 183 Display what invocations were recieved when the expected one hasn't been met
- 186 Methods that are not virtual gives non-sense-exception message
- 188 More
Callback
Overloads - 199 Simplify
SetupAllProperties
implementation to simply iterate and callSetupProperty
- 200 Fluent mock does not honor parent mock
CallBase
setting. - 202
Mock.Protected().Expect()
deprecated with no work-around - 204 Allow default return values to be specified (per-mock)
- 205 Error calling
SetupAllProperties
forMock<IDataErrorInfo>
- 206 Linq-to-Mocks Never Returns on Implicit Boolean Property
- 207
NullReferenceException
thrown when usingMocks.CreateQuery
with implicit boolean expression - 208 Can't setup a mock for method that accept lambda expression as argument.
- 211
SetupAllProperties
should return theMock<T>
instead ofvoid
. - 223 When a method is defined to make the setup an asserts mock fails
- 226 Can't raise events on mocked Interop interfaces
- 229
CallBase
is not working for virtual events - 238 Moq fails to mock events defined in F#
- 239 Use
Func
instead ofPredicate
- 250 4.0 Beta 2 regression - cannot mock
MethodInfo
when targetting .NET 4 - 251 When a generic interface also implements a non-generic version,
Verify
does not work in some cases - 254 Unable to create mock of
EnvDTE.DTE
- 261 Can not use protected setter in public property
- 267 Generic argument as dependency for method
Setup
overrides all previous method setups for a given method - 273 Attempting to create a mock thrown a Type Load exception. The message refers to an inaccessible interface.
- 276 .Net 3.5 no more supported
- 87
- ๐คก Linq to Mocks:
-
v3.0 Changes
- ๐ 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.)
-
v2.6 Changes
- ๐คก Implemented Issue #55: We now provide a
mock.DefaultValue
= [DefaultValue.Empty
|DefaultValue.Mock
] which will provide the current behavior (default) or mocks for mockeable return types for loose mock invocations without expectations. - โ Added support for stubbing properties from moq-contrib: now you can do
mock.Stub(m => m.Value)
and add stub behavior to the property.mock.StubAll()
is also provided. This integrates with theDefaultValue
behavior too, so you can stub entire hierarchies :). - โ Added support for mocking methods with
out
andref
parameters (Issue #50) - ๐คก Applied patch contributed by slava for Issue #72: add support to limit numbor of calls on mocked method (we now have
mock.Expect(...).AtMost(5)
) - ๐ Implemented Issue #94: Easier setter verification: Now we support
ExpectSet(m = m.Value, "foo")
andVerifySet(m = m.Value, 5)
(Thanks ASP.NET MVC Team!) - ๐คก Implemented issue #96: Automatically chain mocks when setting expectations. It's now possible to specify expectations for an entire hierarchy of objects just starting from the root mock. THIS IS REALLY COOL!!!
- ๐ Fixed Issue #89:
Expects()
does not always return last expectation - Implemented Issue 91: Expect a method/property to never be called (added
Never()
method to an expectation. Can be used on methods, property getters and setters) - ๐ Fixed Issue 86:
IsAny<T>
should check if the value is actually of typeT
- ๐ Fixed Issue 88: Cannot mock protected internal virtual methods using
Moq.Protected
- ๐ Fixed Issue 90: Removing event handlers from mocked objects
- โก๏ธ Updated demo and added one more test for the dynamic addition of interfaces
- ๐คก Implemented Issue #55: We now provide a
-
v2.5 Changes
- โ Added support for mocking protected members
- โ Added new way of extending argument matchers which is now very straightforward
- โ Added support for mocking events
- โ Added support for firing events from expectations
- โ Removed usage of MBROs which caused inconsistencies in mocking features
- โ Added
ExpectGet
andExpectSet
to better support properties, and provide better intellisense. - โ Added verification with expressions, which better supports Arrange-Act-Assert testing model (can do
Verify(m => m.Do(...)))
- โ Added
Throws<TException>
- โ Added
mock.CallBase
property to specify whether the virtual members base implementation should be called - โ Added support for implementing and setting expectations and verifying additional interfaces in the mock, via the new
mock.As<TInterface>()
method (thanks Fernando Simonazzi!) - ๐ Improved argument type matching for
Is
/IsAny
(thanks Jeremy.Skinner!)
-
v2.0 Changes
- ๐จ Refactored fluent API on mocks. This may cause some existing tests to fail, but the fix is trivial (just reorder the calls to
Callback
,Returns
andVerifiable
) - โ Added support for retrieving a
Mock<T>
from aT
instance created by a mock. - โ Added support for retrieving the invocation arguments from a
Callback
orReturns
. - Implemented
AtMostOnce()
constraint - โ Added support for creating MBROs with protected constructors
- ๐คก Loose mocks now return default empty arrays and
IEnumerables
instead ofnull
s
- ๐จ Refactored fluent API on mocks. This may cause some existing tests to fail, but the fix is trivial (just reorder the calls to