Mocked method returning null when called from a different project
问题 I have this test class: using NSubstitute; using NUnit.Framework; using System; using System.Linq.Expressions; namespace MyTests { public class Tests { [Test] public void Test() { var companyBL = Substitute.For<ICompanyBL>(); companyBL.GetCompany(c => new { c.RegionID }).ReturnsForAnyArgs(new { RegionID = 4, }); var company = companyBL.GetCompany(c => new { c.RegionID }); var dataRetriever = new DataRetriever(companyBL); } } } and this code in another project: namespace MyTests { using System