Exemple #1
0
        public void GetStationWithInvalidIntIdFromRadio(int id)
        {
            IRadio      _radio = IRadioConstructor.CreateRadio();
            IStreamable result = _radio.GetStation(id);

            Assert.That(result.Name, Is.EqualTo(""));
        }
Exemple #2
0
        public void GetStationWithValidIntId()
        {
            IRadio      _radio = IRadioConstructor.CreateRadio();
            IStreamable result = _radio.GetStation(0);

            Assert.That(result.Name, Is.EqualTo("Radio 1"));
        }
        private void StationsListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //gets the station info from the radio
            ListBox     listBox         = (ListBox)sender;
            IStreamable selectedStation = _radio.GetStation(listBox.SelectedIndex);

            //puts the data in the text boxes for editing
            urlTextBox.Text  = selectedStation.URL.ToString();
            nameTextBox.Text = selectedStation.Name;
        }
Exemple #4
0
        internal void RefreshUI()
        {
            volumeLabel.Content  = !_radio.IsOn ? "" : _radio.IsMuted ? "Muted" : $"Volume: {_radio.Volume}";
            channelLabel.Content = _radio.IsOn ? _radio.GetStation(_currentChannelID).Name : "Powered off";

            PowerImage.Source = new BitmapImage(new Uri(_radio.IsOn ? @"\Images\PowerOff.png" : @"\Images\PowerOff.png", UriKind.Relative));
            MuteImage.Source  = new BitmapImage(new Uri(_radio.IsOn && _radio.IsMuted ? @"\Images\UnmuteIcon.png" : @"\Images\MuteIcon.png", UriKind.Relative));

            channel1Button.Content = _radio.GetStation(0).Name;
            channel2Button.Content = _radio.GetStation(1).Name;
            channel3Button.Content = _radio.GetStation(2).Name;
            channel4Button.Content = _radio.GetStation(3).Name;
        }