NUnit Mocking not working for Singleton Method
问题 Bear with me, I'm new to NUnit. I come from the land of Rails, so some of this is new to me. I have a line of code that looks like this: var code = WebSiteConfiguration.Instance.getCodeByCodeNameAndType("CATALOG_Brands_MinQty", item.Catalog); I'm trying to mock it, like this (assume code is already initialized): var _websiteConfigurationMock = new DynamicMock(typeof(WebSiteConfiguration)); _websiteConfigurationMock.ExpectAndReturn("getCodeByCodeNameAndType", code); When I debug the test,