Skip to content

Releases: PosInformatique/PosInformatique.Moq.Analyzers

v1.11.0

28 Oct 03:23
2a5b492
Compare
Choose a tag to compare

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).

Nuget package

v1.10.0

02 Sep 13:39
dd853ba
Compare
Choose a tag to compare

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.

Nuget package

v1.9.3

19 Aug 09:13
ba32035
Compare
Choose a tag to compare

Improvements/Fixes

  • Fix the PosInfoMoq2006 which raised an error when setup a property/method in inherited classes (fixes #31).

Nuget package

v1.9.2

06 Aug 09:16
b0e56a2
Compare
Choose a tag to compare

Improvements/Fixes

Nuget package

v1.9.1

06 Aug 09:14
d639007
Compare
Choose a tag to compare

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 the Mock.Of<T>() method (fixes #27).

Nuget package

v1.8.0

03 Jul 06:31
282546d
Compare
Choose a tag to compare

New rules:

  • PosInfoMoq1003: The Callback() method should be used to check the parameters when mocking a method with It.IsAny<T>() arguments. (fixes #21).
  • PosInfoMoq1004: The Callback() parameter should not be ignored if it has been setup as an It.IsAny<T>() argument. (fixes #21).

Nuget package

v1.7.0

28 Jun 03:57
fc643f3
Compare
Choose a tag to compare

New rules:

  • PosInfoMoq1002: Verify() methods should be called when Verifiable() 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).

Nuget package

v1.6.0

24 Jun 07:16
da2f494
Compare
Choose a tag to compare

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() and Verify() 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.

Nuget package

v1.5.0

10 Jun 15:57
f19dd54
Compare
Choose a tag to compare

New rules

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).

Nuget package

v1.4.0

26 Feb 09:53
6880a50
Compare
Choose a tag to compare
  • 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).

Nuget package