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."); }
public static void RegisterNetCoreServer <T>(this ServerRegistry reg, string name) where T : class { var netCoreServerBuilder = new NetCoreServerBuilder <T>(); reg.Register(name, netCoreServerBuilder); }
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); }
public static void RegisterProxyServer(this ServerRegistry reg, string name, string address) { reg.Register(name, new ProxyServerBuilder(address)); }