public void Client_ShouldRaiseDisconnect() { var done = new AutoResetEvent(false); var client = new SpeedDateClient(); client.Started += () => { done.Set(); }; client.Start(new DefaultConfigProvider( new NetworkConfig(SetUp.MasterServerIp, SetUp.MasterServerPort), //Connect to port PluginsConfig.DefaultPeerPlugins)); //Load peer-plugins only done.WaitOne(TimeSpan.FromSeconds(30)).ShouldBeTrue(); client.Stopped += () => { done.Set(); }; client.Stop(); done.WaitOne(TimeSpan.FromSeconds(5)).ShouldBeTrue(); client.IsConnected.ShouldBeFalse(); }
public void GetPlugin_ShouldReturnSameObject() { using (var client = new SpeedDateClient()) { client.Start(new DefaultConfigProvider( //Start loads the plugins new NetworkConfig(SetUp.MasterServerIp, SetUp.MasterServerPort), PluginsConfig.DefaultPeerPlugins)); //Load peer-plugins only var a = client.GetPlugin <AuthPlugin>(); var b = client.GetPlugin <AuthPlugin>(); a.ShouldBe(b); client.Stop(); } }
public void GetPlugin_ShouldResolvePeerPlugins() { using (var client = new SpeedDateClient()) { client.Start(new DefaultConfigProvider( //Start loads the plugins new NetworkConfig(SetUp.MasterServerIp, SetUp.MasterServerPort), PluginsConfig.DefaultPeerPlugins)); //Load peer-plugins only client.GetPlugin <AuthPlugin>().ShouldNotBeNull(); client.GetPlugin <ChatPlugin>().ShouldNotBeNull(); client.GetPlugin <LobbyPlugin>().ShouldNotBeNull(); client.GetPlugin <MatchmakerPlugin>().ShouldNotBeNull(); client.GetPlugin <ProfilePlugin>().ShouldNotBeNull(); client.GetPlugin <RoomPlugin>().ShouldNotBeNull(); client.GetPlugin <SecurityPlugin>().ShouldNotBeNull(); client.GetPlugin <SpawnRequestPlugin>().ShouldNotBeNull(); client.Stop(); } }
public void Stop() { _client.Stop(); }