public void RebroadcastServerManager_Dispose_Prevents_FeedManager_Changes_From_Creating_New_Servers() { FeedHelper.RemoveFeed(_Feeds, _Listeners, 1); _Manager.Initialise(); _Manager.Dispose(); FeedHelper.AddFeeds(_Feeds, _Listeners, 1); _FeedManager.Raise(r => r.FeedsChanged += null, EventArgs.Empty); Assert.AreEqual(0, _Manager.RebroadcastServers.Count); _Server.Verify(r => r.Initialise(), Times.Never()); }
public void RebroadcastServerManager_ConfigurationChanged_Chooses_Correct_Feed() { _RebroadcastSettings.Enabled = false; _Manager.Initialise(); _RebroadcastSettings.ReceiverId = 2; FeedHelper.AddFeeds(_Feeds, _Listeners, 2); _RebroadcastSettings.Enabled = true; _ConfigurationStorage.Raise(r => r.ConfigurationChanged += null, EventArgs.Empty); Assert.AreEqual(1, _Manager.RebroadcastServers.Count); Assert.AreSame(_Feeds[1].Object, _Manager.RebroadcastServers[0].Feed); }
public void RebroadcastServerManager_FeedsChanged_Creates_Servers_For_New_Feeds() { _RebroadcastSettings.ReceiverId = 99; _Manager.Initialise(); Assert.AreEqual(0, _Manager.RebroadcastServers.Count); FeedHelper.AddFeeds(_Feeds, _Listeners, 99); _FeedManager.Raise(r => r.FeedsChanged += null, EventArgs.Empty); Assert.AreEqual(1, _Manager.RebroadcastServers.Count); Assert.AreSame(_Server.Object, _Manager.RebroadcastServers[0]); Assert.AreSame(_Feeds[2].Object, _Server.Object.Feed); Assert.AreSame(_Connector.Object, _Server.Object.Connector); Assert.AreEqual(1000, _Connector.Object.Port); Assert.AreEqual(true, _Connector.Object.IsPassive); Assert.AreEqual(RebroadcastFormat.Passthrough, _Server.Object.Format); Assert.AreEqual(false, _Server.Object.Online); }