Automocking container with Moq

Posted by: eXtensible mind, on 19 Nov 2008 | View original | Bookmarked: 0 time(s)

I realized that I never blogged about this cool feature contributed by Slava to Moq-Contrib. Auto-mocking containers was an idea originally (IIRC) from the guys at Eleutian, later on picked up by Jeremy Miller with Rhino Mocks and StructureMap. The wiki document Slava put together on Automocking is a fantastic overview. Basically, you can have an (Autofac-powered) container create your objects under test with all its dependencies injected as mocks:var factory = new MockFactory(MockBehavior.Loose);var...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: Debugger | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 2306 | Hits: 125

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD