Skip to content

Releases: PosInformatique/PosInformatique.Moq.Analyzers

v2.0.1

15 Nov 15:15
2059ab7

Choose a tag to compare

Improvements/Fixes

  • Fix the PosInfoMoq2005 which raised an error with constructor that contains array parameters (fixes #55).

Nuget package

v2.0.0

09 Oct 14:11
2eb6f8d

Choose a tag to compare

New rules

  • PosInfoMoq1010: Use += null syntax when raising events with Raise()/RaiseAsync() (fixes #52).
  • PosInfoMoq2001: Add the support of the SetupSequence() methods. (fixes #33).
  • PosInfoMoq2017: Mock<T>.Raise()/RaiseAsync() must use parameters matching the event signature (fixes #51).
  • PosInfoMoq2018: The first parameter of Raise()/RaiseAsync() must be an event (fixes #51).
  • PosInfoMoq2019: RaiseAsync() must be used only for events with async handlers (returning Task) (fixes #51).
    This is a major improvement to detect the bug of Moq related to the devlooped/moq#1568 issue (and the related PR devlooped/moq#1571 proposed fix which is still not approved).

New fixers

  • PosInfoMoq1000: The fixer add a call for missing VerifyAll() at the end of the unit tests. (fixes #53).

v1.13.0

01 Oct 07:10
ff5ecb1

Choose a tag to compare

New rules

Improvements/Fixes

  • When using It.IsAny<T>() or It.Is<T>() with inherited class, the PosInfoMoq1006 was raised (fixes #47).

Nuget package

v1.12.0

01 Sep 14:44
74d3525

Choose a tag to compare

New rules

  • PosInfoMoq1006: The It.IsAny<T>() or It.Is<T>() arguments must match the parameters of the mocked method. (fixes #44).

Nuget package

v1.11.0

28 Oct 03:23
2a5b492

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

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

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

Choose a tag to compare

Improvements/Fixes

Nuget package

v1.9.1

06 Aug 09:14
d639007

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

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