public void StrategyThrowsIfWireupIsNeededAndBrokerNotInLocator() { MockBuilderContext context = CreateContext(); NamedTypeBuildKey buildKey = NamedTypeBuildKey.Make<OneEventPublisher>(); EventBrokerInfoPolicy policy = new EventBrokerInfoPolicy(); policy.AddPublication("paste", "Pasting"); context.Policies.Set<IEventBrokerInfoPolicy>(policy, buildKey); try { OneEventPublisher existing = new OneEventPublisher(); context.ExecuteBuildUp(buildKey, existing); } catch (Exception) { // If we got here, we're Ok, this is expected. return; } Assert.Fail("No exception occured"); }
public void StrategyThrowsIfWireupIsNeededAndBrokerNotInLocator() { MockBuilderContext context = CreateContext(); NamedTypeBuildKey buildKey = NamedTypeBuildKey.Make <OneEventPublisher>(); EventBrokerInfoPolicy policy = new EventBrokerInfoPolicy(); policy.AddPublication("paste", "Pasting"); context.Policies.Set <IEventBrokerInfoPolicy>(policy, buildKey); try { OneEventPublisher existing = new OneEventPublisher(); context.ExecuteBuildUp(buildKey, existing); } catch (Exception) { // If we got here, we're Ok, this is expected. return; } Assert.Fail("No exception occured"); }