public void ButIfFactoryMethodIsMissing_ThenCreateFromFactoryMethodAttributeConstructorThrows() { Assert.Throws <InvalidOperationException>(() => { new CreateFromFactoryMethod(typeof(AClass), typeof(AFactory), "BuildMethodNameWhichDoesntExist"); }); }
public void ButIfFactoryMethodIsMissing_ThenAAThrows_WithOrWithoutAnAnchor() { var rules = new[] { new CreateFromFactoryMethod(typeof(AClass), "BuildMethodNameWhichDoesntExist") }; // Assert.Throws <InvalidOperationException>( () => new AnythingActivator(rules, andUseDefaultRules: false).New <AClass>() ); Assert.Throws <InvalidOperationException>( () => new AnythingActivator( this, instances: null, rules: rules, andUseDefaultRules: false) .New <AClass>() ); }