public void StrategyThrowsIfNamedObjectNotPresent() { MockBuilderContext context = CreateContext(); context.HeadOfChain.BuildUp(context, typeof(NamedThrowingMockObject), null, null); }
public void SpecifyingCreateNewAndDependencyThrows() { MockBuilderContext context = CreateContext(); context.HeadOfChain.BuildUp(context, typeof(MockInvalidDualAttributes), null, null); }
public void RequestForLogWriterWithoutSettingsThrows() { MockBuilderContext context = CreateContext(null, new DictionaryConfigurationSource()); context.HeadOfChain.BuildUp(context, typeof(LogWriter), null, null); }
public void CreationStrategyWithNoPoliciesFails() { MockBuilderContext ctx = CreateContext(); ctx.HeadOfChain.BuildUp(ctx, typeof(object), null, null); }
public void BuildUpWithNoMethodChooserRaisesNullException() { MockBuilderContext ctx = BuildContext(); MockObject mockInstance = (MockObject)ctx.HeadOfChain.BuildUp(ctx, typeof(MockObject), null, null); }
private MockBuilderContext CreateContext() { MockBuilderContext result = new MockBuilderContext(); result.InnerChain.Add(new SingletonStrategy()); result.InnerChain.Add(new CreationStrategy()); return result; }
public void ThrowsIfConcreteTypeToCreateCannotBeCreated() { MockBuilderContext context = CreateContext(); context.HeadOfChain.BuildUp(context, typeof(MockDependsOnInterface), null, null); }
public void SpecifyingMultipleConstructorsThrows() { MockBuilderContext context = CreateContext(); context.HeadOfChain.BuildUp(context, typeof(MockInvalidDualConstructorAttributes), null, null); }
public void CanCreateValueTypesWithConstructorInjectionStrategyInPlace() { MockBuilderContext context = CreateContext(); Assert.AreEqual(0, context.HeadOfChain.BuildUp(context, typeof(int), null, null)); }