public void reading_settings() { var channel = new ChannelSettings { Outbound = new Uri("channel://outbound"), Downstream = new Uri("channel://downstream") }; var bus = new BusSettings { Outbound = new Uri("bus://outbound"), Downstream = new Uri("bus://downstream") }; var services = new InMemoryServiceLocator(); services.Add(channel); services.Add(bus); var graph = new ChannelGraph(); graph.ChannelFor<ChannelSettings>(x => x.Outbound); graph.ChannelFor<ChannelSettings>(x => x.Downstream); graph.ChannelFor<BusSettings>(x => x.Outbound); graph.ChannelFor<BusSettings>(x => x.Downstream); graph.ReadSettings(services); graph.ChannelFor<ChannelSettings>(x => x.Outbound) .Uri.ShouldEqual(channel.Outbound); graph.ChannelFor<ChannelSettings>(x => x.Downstream) .Uri.ShouldEqual(channel.Downstream); graph.ChannelFor<BusSettings>(x => x.Outbound) .Uri.ShouldEqual(bus.Outbound); graph.ChannelFor<BusSettings>(x => x.Downstream) .Uri.ShouldEqual(bus.Downstream); }
public void reading_settings() { var channel = new ChannelSettings { Outbound = new Uri("channel://outbound"), Downstream = new Uri("channel://downstream") }; var bus = new BusSettings { Outbound = new Uri("bus://outbound"), Downstream = new Uri("bus://downstream") }; var services = new InMemoryServiceLocator(); services.Add(channel); services.Add(bus); var graph = new ChannelGraph(); graph.ChannelFor <ChannelSettings>(x => x.Outbound); graph.ChannelFor <ChannelSettings>(x => x.Downstream); graph.ChannelFor <BusSettings>(x => x.Outbound); graph.ChannelFor <BusSettings>(x => x.Downstream); graph.ReadSettings(services); graph.ChannelFor <ChannelSettings>(x => x.Outbound) .Uri.ShouldEqual(channel.Outbound); graph.ChannelFor <ChannelSettings>(x => x.Downstream) .Uri.ShouldEqual(channel.Downstream); graph.ChannelFor <BusSettings>(x => x.Outbound) .Uri.ShouldEqual(bus.Outbound); graph.ChannelFor <BusSettings>(x => x.Downstream) .Uri.ShouldEqual(bus.Downstream); }