示例#1
0
        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());
        }
示例#2
0
        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());
        }
示例#3
0
        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());
        }