We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This seems similar to issue #47 but I am still seeing this in 1.0.10.
When using an initializer in a returns, I get an analysis error NS4000 even if there is no nested returns.
public class TestClass { [Fact] public void NS4000_FalsePositive() { IBook book = SetupBook(); var bookFinder = Substitute.For<IBookFinder>(); bookFinder.FavoriteBook.Returns(book); // Doesn't shows analysis error bookFinder.Books.Returns(new List<IBook>() { book }); // Shows analysis error bookFinder.BookPromoter.Returns(new BookPromoter() { PromotedBook = book }); // Shows analysis error Assert.Contains(book, bookFinder.Books); } private static IBook SetupBook() { var model = Substitute.For<IBook>(); model.IsFiction.Returns(true); return model; } } public interface IBook { bool IsFiction { get; set; } } public interface IBookFinder { ICollection<IBook> Books { get; } IBook FavoriteBook { get; } IBookPromoter BookPromoter { get; } } public interface IBookPromoter { IBook PromotedBook { get; set; } } public class BookPromoter : IBookPromoter { public IBook PromotedBook { get; set; } }
The text was updated successfully, but these errors were encountered:
Thanks for reporting, your issue has the same root-cause as #106 which was fixed by #107. Fix will be available in next version
Sorry, something went wrong.
No branches or pull requests
This seems similar to issue #47 but I am still seeing this in 1.0.10.
When using an initializer in a returns, I get an analysis error NS4000 even if there is no nested returns.
The text was updated successfully, but these errors were encountered: