Example #1
0
        public void SessionCreatedEvent_SessionShouldBeAdded()
        {
            var sessionCount = model.Sessions.Count;
            var newSession   = AudioSessionModelTests.GetSessionMock("session", 50, true);

            this.sProviderMock.Raise(m => m.SessionCreated += null, new object[] { newSession });

            Assert.Equal(sessionCount + 1, this.model.Sessions.Count);
            Assert.Contains(newSession, this.model.Sessions);
        }
Example #2
0
        public OutputDeviceModelTests()
        {
            var master   = MasterSessionModelTests.GetMasterMock(deviceName, 70, false, new BitmapImage());
            var sessions = new ObservableCollection <AudioSessionModel>();

            sessions.Add(AudioSessionModelTests.GetSessionMock("app", 50, false));

            this.deviceMock = new Mock <IDevice>();

            this.deviceMock.Setup(m => m.GetId()).Returns(deviceId);

            this.deviceStateMock = new Mock <IDeviceStateNotificationHandler>();
            this.sProviderMock   = new Mock <ISessionProvider>();

            this.model = new OutputDeviceModel(deviceMock.Object, deviceStateMock.Object, sProviderMock.Object, master, sessions);
        }
Example #3
0
        internal static OutputDeviceModel GetDeviceMock(string id, string name, IDeviceStateNotificationHandler deviceStateHandler)
        {
            var master   = MasterSessionModelTests.GetMasterMock(name, 70, false, null);
            var sessions = new ObservableCollection <AudioSessionModel>();

            sessions.Add(AudioSessionModelTests.GetSessionMock("app", 50, false));

            var deviceMock = new Mock <IDevice>();

            deviceMock.Setup(m => m.GetId()).Returns(id);

            var sProviderMock = new Mock <ISessionProvider>();

            return(new OutputDeviceModel(deviceMock.Object, deviceStateHandler, sProviderMock.Object, master,
                                         sessions));
        }