Moq v2.6 Release Notes

    • ๐Ÿคก 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 the DefaultValue behavior too, so you can stub entire hierarchies :).
    • โž• Added support for mocking methods with out and ref 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") and VerifySet(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 type T
    • ๐Ÿ›  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