Esempio n. 1
0
        public void TestInitialise()
        {
            _OriginalFactory = Factory.TakeSnapshot();

            _SharedConfiguration = TestUtilities.CreateMockSingleton <ISharedConfiguration>();
            _Configuration       = new Configuration();
            _SharedConfiguration.Setup(cs => cs.Get()).Returns(_Configuration);

            _Log = TestUtilities.CreateMockSingleton <ILog>();
            _HeartbeatService = TestUtilities.CreateMockSingleton <IHeartbeatService>();
            _WebServer        = new Mock <IWebServer>()
            {
                DefaultValue = DefaultValue.Mock
            }.SetupAllProperties();
            _AutoConfigWebServer = TestUtilities.CreateMockSingleton <IAutoConfigWebServer>();
            _AutoConfigWebServer.Setup(s => s.WebServer).Returns(_WebServer.Object);
            _UPnpManager = new Mock <IUniversalPlugAndPlayManager>()
            {
                DefaultValue = DefaultValue.Mock
            }.SetupAllProperties();
            _NewVersionChecker        = TestUtilities.CreateMockSingleton <INewVersionChecker>();
            _HeartbeatTick            = new EventRecorder <EventArgs>();
            _BaseStationAircraftList  = new Mock <IBaseStationAircraftList>();
            _PluginManager            = TestUtilities.CreateMockSingleton <IPluginManager>();
            _RebroadcastServerManager = TestUtilities.CreateMockSingleton <IRebroadcastServerManager>();
            _UserManager = TestUtilities.CreateMockSingleton <IUserManager>();

            _Feeds     = new List <Mock <IFeed> >();
            _Listeners = new List <Mock <IListener> >();
            var useVisibleFeeds = false;

            _FeedManager = FeedHelper.CreateMockFeedManager(_Feeds, _Listeners, useVisibleFeeds, 1, 2);

            _Clock = new ClockMock();
            Factory.Singleton.RegisterInstance <IClock>(_Clock.Object);

            _Presenter = Factory.Singleton.Resolve <IMainPresenter>();
            _View      = new Mock <IMainView>()
            {
                DefaultValue = DefaultValue.Mock
            }.SetupAllProperties();
        }
        public void TestInitialise()
        {
            _OriginalClassFactory = Factory.TakeSnapshot();

            _Server = TestUtilities.CreateMockImplementation <IRebroadcastServer>();

            _Connector = new MockConnector <INetworkConnector, INetworkConnection>();
            Factory.Singleton.RegisterInstance <INetworkConnector>(_Connector.Object);
            _Connector.Object.Authentication = null;

            _PassphraseAuthentication = TestUtilities.CreateMockImplementation <IPassphraseAuthentication>();

            _Feeds     = new List <Mock <IFeed> >();
            _Listeners = new List <Mock <IListener> >();
            var useVisibleFeeds = false;

            _FeedManager = FeedHelper.CreateMockFeedManager(_Feeds, _Listeners, useVisibleFeeds, 1, 2);

            _ConfigurationStorage = TestUtilities.CreateMockSingleton <IConfigurationStorage>();
            _Configuration        = new Configuration();
            _ConfigurationStorage.Setup(r => r.Load()).Returns(_Configuration);
            _RebroadcastSettings = new RebroadcastSettings()
            {
                UniqueId     = 22,
                Name         = "A",
                Enabled      = true,
                Port         = 1000,
                Format       = RebroadcastFormat.Passthrough,
                ReceiverId   = 1,
                StaleSeconds = 3,
                Access       =
                {
                    DefaultAccess = DefaultAccess.Allow,
                },
                IsTransmitter            = false,
                SendIntervalMilliseconds = 1000,
            };
            _Configuration.RebroadcastSettings.Add(_RebroadcastSettings);

            _Manager = Factory.Singleton.Resolve <IRebroadcastServerManager>();
        }