public void FakeNetworkControllerConnectToMulticastGroup() { FakeNetworkController nc = new FakeNetworkController(); Networking.NetworkController = nc; Networking.Start(); MulticastRemoteSubscriptionhandle h = new MulticastRemoteSubscriptionhandle(); Networking.ConnectToMulticast(h.IpAddress, h.Port); TestSubscriber s = new TestSubscriber(); s.Subscribe(); Assert.IsTrue(FakeNetworkController.connectedToMulticastgroup); }
public void NetworkControllerConnectToMulticastGroup() { NetworkController nc = new NetworkController(); FakeServer server = new FakeServer(); FakeSender sender = new FakeSender(); nc.Servers.Add(server); Networking.NetworkController = nc; Networking.Start(); SenderBase.FactoryMethod = e => sender; MulticastRemoteSubscriptionhandle h = new MulticastRemoteSubscriptionhandle(); Networking.ConnectToMulticast(h.IpAddress, h.Port); TestSubscriber s = new TestSubscriber(); s.Subscribe(); Assert.IsTrue(server._connectedToMulticastGroup); }