Esempio n. 1
0
        public CoreDaemonHostTestBase() : base()
        {
            DefaultDaemonApp = new BaseTestApp
            {
                Id        = "app_id",
                IsEnabled = true
            };

            DefaultDaemonHost.AddRunningApp(DefaultDaemonApp);

            DefaultDaemonRxApp = new BaseTestRxApp
            {
                Id        = "app_rx_id",
                IsEnabled = true
            };
            DefaultDaemonHost.AddRunningApp(DefaultDaemonRxApp);

            DefaultMockedRxApp = new Mock <NetDaemonRxApp>()
            {
                CallBase = true
            };
            DefaultMockedRxApp.Object.Id        = "app_rx_mock_id";
            DefaultMockedRxApp.Object.IsEnabled = true;
            DefaultMockedRxApp.Setup(n => n.CreateObservableIntervall(It.IsAny <TimeSpan>(), It.IsAny <Action>())).Returns(new Mock <IDisposable>().Object);

            DefaultDaemonHost.AddRunningApp(DefaultMockedRxApp.Object);

            var notConnectedHassClientFactoryMock = new HassClientFactoryMock(HassClientMock.MockConnectFalse);

            _notConnectedDaemonHost = new NetDaemonHost(notConnectedHassClientFactoryMock.Object, DefaultDataRepositoryMock.Object, LoggerMock.LoggerFactory);

            SetupFakeData();
        }
Esempio n. 2
0
        public CoreDaemonHostTestBase() : base()
        {
            DefaultDaemonApp = new BaseTestApp
            {
                Id        = "app_id",
                IsEnabled = true
            };

            DefaultDaemonHost.InternalRunningAppInstances[DefaultDaemonApp.Id !] = DefaultDaemonApp;