Moq v4.0 Release Notes
-
- 🤡 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: