예제 #1
0
        public void ShouldPreventDoubleRegistration()
        {
            var reg = new ServerRegistry();

            reg.Register("Test", new MockServerBuilder("test"));
            Action act = () => reg.Register("Test", new MockServerBuilder("test2"));

            act.Should().Throw <ServerRegistrationException>()
            .WithMessage("The server 'Test' has already been registered with the server registry. Perhaps you are accidentally including it in more than one IRegisterServers implementation.");
        }
예제 #2
0
        public static void RegisterNetCoreServer <T>(this ServerRegistry reg, string name)
            where T : class
        {
            var netCoreServerBuilder = new NetCoreServerBuilder <T>();

            reg.Register(name, netCoreServerBuilder);
        }
예제 #3
0
        public static void RegisterNetCoreServer <T>(this ServerRegistry reg, string name, IConfigurationBuilder config)
            where T : class
        {
            var netCoreServerBuilder = new NetCoreServerBuilder <T>();

            netCoreServerBuilder.WithConfig(config);
            reg.Register(name, netCoreServerBuilder);
        }
예제 #4
0
 public static void RegisterProxyServer(this ServerRegistry reg, string name, string address)
 {
     reg.Register(name, new ProxyServerBuilder(address));
 }