public void Route_TwoSegmentsProxied_ClaimedMethodsExecuted() { var configuration = ExtensibilityConfigurationProvider.LoadConfiguration(); var context = new PluginContext(_strategy); var hostAdapter = new HostAdapter <ISegmentedContract>(context, configuration); var proxy = RoutableProxy.Create <ISegmentedContract>(hostAdapter); Assert.Equal(ISegmentedContract.FirstSomeMethod, proxy.SomeMethod()); Assert.Equal(ISegmentedContract.SecondSomeOtherMethod, proxy.SomeOtherMethod()); }
public void Route_XmlConfig_ClaimedMethodsExecuted() { var configuration = CreateAlphaPrimaryConfiguration(); var context = new PluginContext(_strategy); var hostAdapter = new HostAdapter <ISegmentedContract>(context, configuration); var proxy = RoutableProxy.Create <ISegmentedContract>(hostAdapter); Assert.Equal(ISegmentedContract.FirstSomeMethod, proxy.SomeMethod()); Assert.Equal(ISegmentedContract.SecondSomeOtherMethod, proxy.SomeOtherMethod()); }
public void Route_JsonConfig_ClaimedMethodsExecuted() { var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("test.json"); var configurationRoot = builder.Build(); var configuration = configurationRoot.Get <ExtensibilityConfiguration>(); var context = new PluginContext(_strategy); var hostAdapter = new HostAdapter <ISegmentedContract>(context, configuration); var proxy = RoutableProxy.Create <ISegmentedContract>(hostAdapter); Assert.Equal(ISegmentedContract.FirstSomeMethod, proxy.SomeMethod()); Assert.Equal(ISegmentedContract.SecondSomeOtherMethod, proxy.SomeOtherMethod()); }