public void TestHeadsetDisconnected()
        {
            var statusMock = new Moq.Mock<ICicStatusService>();
            var deviceManagerMock = new Moq.Mock<IDeviceManager>();
            var settingsManagerMock = new Moq.Mock<ISettingsManager>();

            settingsManagerMock.SetupGet(s => s.HeadsetDisconnectStatusKey).Returns(STATUS_KEY);
            settingsManagerMock.SetupGet(s => s.HeadsetDisconnectChangeStatus).Returns(true);

            var target = new StatusChanger(null, statusMock.Object, deviceManagerMock.Object, settingsManagerMock.Object);

            deviceManagerMock.Raise(d => d.HeadsetDisconnected += null, new Plantronics.UC.SpokesWrapper.ConnectedStateArgs(true, true));

            statusMock.Verify(cic => cic.SetStatus(STATUS_KEY));
        }
Beispiel #2
0
        public void Load(IServiceProvider serviceProvider)
        {
            try
            {
                s_traceContext = (ITraceContext)serviceProvider.GetService(typeof(ITraceContext));

                //must have the icelib sdk license to get the session as a service
                s_session = (Session)serviceProvider.GetService(typeof(Session));
                s_connection = new Connection.Connection(s_session);
            }
            catch (ArgumentNullException)
            {
                s_traceContext.Error("unable to get Icelib Session, is the ICELIB SDK License available?");
                Debug.Fail("unable to get service.  Is the ICELIB SDK licence available?");
                throw;
            }

            s_interactionManager = new InteractionManager(s_session, (IQueueService)serviceProvider.GetService(typeof(IQueueService)), s_traceContext);
            s_statusManager = new CicStatusService(s_session, s_traceContext);
            s_notificationService = (INotificationService)serviceProvider.GetService(typeof(INotificationService));

            s_settingsManager = new SettingsManager();
            s_deviceManager = new DeviceManager(s_traceContext, new SpokesDebugLogger(s_traceContext));

            s_statusChanger = new StatusChanger(s_session, s_statusManager, s_deviceManager, s_settingsManager);
            s_notificationServer = new NotificationServer(s_deviceManager, s_settingsManager, s_notificationService);

            s_hookSwitchManager = new InteractionSyncManager(s_interactionManager, s_deviceManager, (IQueueService)serviceProvider.GetService(typeof(IQueueService)), s_traceContext, s_connection);

            s_outboundEventNotificationService = new OutboundEventNotificationService(s_session, s_statusManager, s_deviceManager, s_traceContext);

            s_traceContext.Always("Plantronics AddIn Loaded");
        }