src/packages/NSubstitute.1.8.1.0/BreakingChanges.txt

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

================================================================================================
1.8.0 Release 
================================================================================================

Incorrect use of argument matchers outside of a member call, particularly within a
Returns(), will now throw an exception (instead of causing unexpected behaviour
in other tests: see https://github.com/nsubstitute/NSubstitute/issues/149).

Reason:
Prevent accidental incorrect use from causing hard-to-find errors in unrelated tests.

Fix:
Do not use argument matchers in Returns() or outside of where an argument is normally used.
Correct use:   sub.Method(Arg.Any<string>()).Returns("hi")
Incorrect use: sub.Method().Returns(Arg.Any<string>())

================================================================================================
1.7.0 Release
================================================================================================

Auto-substitute for pure virtual classes with at least one public static method, which
means some methods and properties on substitutes that used to return null by default will now
return a new substitute of that type.

Reason:
Keep consistency with the behaviour of other pure virtual classes.

Fix:
Explicitly return null from methods and property getters when required for a test.
e.g. sub.Method().Returns(x => null);

------------------------------------------------------------------------------------------------

Moved `Received.InOrder` feature from `NSubstitute.Experimental` to main `NSubstitute` namespace.
Obsoleted original `NSubstitute.Experimental.Received`.

This can result in ambiguous reference compiler errors and obsolete member compiler earnings.

Reason:
Promoted experimental Received feature to core library.

Fix:
Import `NSubstitute` namespace instead of `NSubstitute.Experimental`.
(If `NSubstitute` is already imported just delete the `using NSubstitute.Experimental;` line from your fixtures.)

================================================================================================
1.5.0 Release
================================================================================================

The base object methods (Equals, GetHashCode and ToString) for substitute objects of classes that
extend those methods now return the result of calling the actual implementation of those methods
rather than the default value for the return type. This means that places where you relied on
.Equals returning false, .ToString returning null and .GetHashCode returning 0 because the actual
methods weren't called will now call the actual implementation.

Reason:
Substitute objects of classes that overrode those methods that were used as parameters for
setting up return values or checking received calls weren't able to be directly used within the
call, e.g. instead of:

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。