Releases: PosInformatique/PosInformatique.Moq.Analyzers
Releases · PosInformatique/PosInformatique.Moq.Analyzers
v1.11.0
New rules
- PosInfoMoq1005: Defines the generic argument of the
SetupSet()
method with the type of the mocked property (fixes #42). - PosInfoMoq2014: The delegate in the argument of the
Returns()
method must return a value with same type of the mocked method (fixes #35). - PosInfoMoq2015: The
Protected().Setup()
method must match the return type of the mocked method. - PosInfoMoq2016:
Mock<T>
constructor with factory lambda expression can be used only with classes (fixes #40).
Improvements/Fixes
- PosInfoMoq2001: Check that property setup with the
SetupSet()
method are overridable (fixes #42). - Fix the PosInfoMoq1001 rule for the
Mock<T>
instantiation with the lambda expression to create mock instances (fixes #39). - Fix the PosInfoMoq2004 rule for the
Mock<T>
instantiation with the lambda expression to create mock instances (fixes #39). - Fix the PosInfoMoq1001 fixer when using the
Mock.Of<T>
as argument in the constructor call (fixes #41).
v1.10.0
New rules:
- PosInfoMoq2012: The delegate in the argument of the
Returns()
method must return a value with same type of the mocked method. - PosInfoMoq2013: The delegate in the argument of the
Returns()
/ReturnsAsync()
method must have the same parameter types of the mocked method/property.
v1.9.3
Improvements/Fixes
- Fix the PosInfoMoq2006 which raised an error when setup a property/method in inherited classes (fixes #31).
v1.9.2
Improvements/Fixes
- Fix the PosInfoMoq1003 to raise warnings when using InSequence() method (fixes #29).
- Fix the PosInfoMoq2003 to raise errors when using InSequence() method (fixes #29).
v1.9.1
New rules:
- PosInfoMoq2009:
Mock.Of<T>
method must be used only to mock non-sealed class. - PosInfoMoq2010:
Mock.Of<T>
method must be used only with types that contains parameterless contructor. - PosInfoMoq2011: Constructor of the mocked class must be accessible.
Improvements/Fixes
- Updates the PosInfoMoq1001 rule to check
Strict
behavior usage for theMock.Of<T>()
method (fixes #27).
v1.8.0
New rules:
- PosInfoMoq1003: The
Callback()
method should be used to check the parameters when mocking a method withIt.IsAny<T>()
arguments. (fixes #21). - PosInfoMoq1004: The
Callback()
parameter should not be ignored if it has been setup as anIt.IsAny<T>()
argument. (fixes #21).
v1.7.0
New rules:
- PosInfoMoq1002:
Verify()
methods should be called whenVerifiable()
has been setup (fixes #22).
Improvements/Fixes
- Fix the PosInfoMoq1000 rule to check only the call to
VerifyAll()
method (fixes #22). - Fix a bug when developer use custom Setup() method when using Moq (fixes #12).
Internal
- Use Moq NuGet packages for the unit tests (fixes #23).
v1.6.0
New rules
- PosInfoMoq2007: The
As<T>()
method can be used only with interfaces (fixes: #19). - PosInfoMoq2008: The
Verify()
method must be used only on overridable members.
Improvements/fixes
- Add the support of static methods
VerifyAll()
andVerify()
for the PosInfoMoq2000 rule (fixes: #20). - Add hyperlink to the documentation of the rules.
Internal
- Various optimizations to increase speed of analysis.
- Various optimizations to reduce memory usage.
v1.5.0
New rules
- PosInfoMoq2004: Check that no arguments is passed to mocked interface (fixes #14).
- PosInfoMoq2005: Check the arguments passed to mocked abstract classes (fixes #15).
- PosInfoMoq2006: Check setups with Protected() mocks (fixes #10 and fixes #11).
Improvements/fixes
- The PosInfoMoq2000 rule does not raise an error when the
Returns()
/ReturnsAsync()
methods is invalided by the compiler (fixes #16). - The PosInfoMoq2001 rule check that each chained member access in a
Setup()
method is overridable (fixes #17).
Internal
- Propagate the cancellation token to allow to cancel analysis if the host (the compiler for example) cancel the analysis process.
- Migrates the Azure Pipelines to Github actions (fixes #9).
v1.4.0
- Reduce the dependency of Microsoft.CodeAnalysis.CSharp to the release 4.0.1 (allows developper to use the analyzers with old version of the C# compiler).