autofixture

How can I emit a .NET type with two properties that are overloaded only on return type?

I need to create a type that has two properties with the same name, and only differ on return type. Dynamically emitting this type via reflection is perfectly acceptable. Something like this: public TypeA Prop { get; } public TypeB Prop { get; } I do understand that I cannot consume this property from C# or VB.NET or lots of other .N...

AutoFixture refactoring

I started to use AutoFixture http://autofixture.codeplex.com/ as my unit tests was bloated with a lot of data setup. I was spending more time on seting up the data than to write my unit test. Here's an example of how my initial unit test looks like (example taken from cargo application sample from DDD blue book) [Test] public void shoul...

TDD System Under Test Creation Patterns (AutoFixture)

I'm trying to use SUT Factory 'pattern' to create my SUT. Given the SUT structure: namespace MySut { public class Dep1 { } public class Dep2 { } public class Sut { public Sut( Dep1 dep1, Dep2 dep2 ) { } } } I'm using AutoFixture, and am wondering what's the best way to col...

Fixture.CreateAnonymous method kills test runner process with an error (AutoFixture) when using AutoMoq to create a Controller

I'm trying to use the AutoMoqCustomization with AutoFixture to create an ASP.NET MVC2 Controller in a unit test via the Fixture.CreateAnonymous method. I've tried in both xUnit under TestDriven.NET, the xUnit test GUI and in MSTest and all have the same result: a massive failure of the process running the test. On Windows 7 x64 if that...

IList<something> constructor parameter and AutoFixture

Using autofixture, I'm trying to construct anonymous instance of Project: _f=new Fixture().Customize(new AutoMoqCustomization()); _p=_f.CreateAnonymous<Project>(); This fails, cause Project public constructor demands IList<Partner> public Project(/*.....*/,IList<Partner> partners){ Guard.AgainstEmpty(partners); } Stack trace is...