public void ContainerResolvesIngredientThroughExtensionMethod() { var context = new XmlApplicationContext("sauce.xml"); IIngredient ingredient = context.Resolve<IIngredient>(); Assert.IsAssignableFrom<SauceBéarnaise>(ingredient); }
public void ContainerResolvesSauceBéarnaiseThroughExtensionMethod() { var context = new XmlApplicationContext("sauce.xml"); SauceBéarnaise sauce = context.Resolve<SauceBéarnaise>(); Assert.NotNull(sauce); }
public void InterceptTwoTargetsWithTheSameInterceptor() { var context = new XmlApplicationContext("InterceptTwoTargetsWithTheSameInterceptor.xml"); context.Resolve<IFoo>().DoFoo(); context.Resolve<IBar>().DoBar(); var spy = context.Resolve<SpyInterceptor>(); Assert.True(spy.Invocations.Select(i => i.Method.Name).Contains("DoFoo")); Assert.True(spy.Invocations.Select(i => i.Method.Name).Contains("DoBar")); }