public void Should_be_able_to_resolve_a_named_client() { using (var container = new UnityContainer()) { container.RegisterEndpointsFromConfiguration(); var client = container.Resolve<IMockService>("mockClient"); Assert.NotNull(client); } }
private void Arrange() { // ensure that the IMockService type / ServiceContrib.Tests assembly is loaded into the current appdomain. var hack = typeof (IMockService); var hack2 = hack.Name; Debug.WriteLine(hack2); _container = new UnityContainer(); _container.RegisterEndpointsFromConfiguration(); }
public void Should_invoke_action_on_ChannelFactory_upon_configuration() { using (var container = new UnityContainer()) { bool checker = false; container.RegisterEndpointsFromConfiguration(cf => { checker = true; }); Assert.Equal(true, checker); } }
public void Should_register_all_clients_from_configuration_in_container() { using (var container = new UnityContainer()) { container.RegisterEndpointsFromConfiguration(); var client = container.Resolve<IMockService>("mockClient"); var client2 = container.Resolve<IMockService>("mockClient2"); Assert.NotNull(client); Assert.NotNull(client2); } }