예제 #1
0
        private void CreateMp3Song(bool paramFileExists)
        {
            this.mp3File      = new MockMp3File(InitTitle, InitArtist, InitAlbum);
            this.fileModifier = new MockFileModifier(paramFileExists);

            this.mp3Song = new Mp3Song(this.mp3File, this.fileModifier);
        }
예제 #2
0
        public Mp3SongViewModel(Mp3Song paramMp3Song, IDialogService paramDialogService)
        {
            this.dialogService = paramDialogService;
            this.mp3Song       = paramMp3Song;

            this.InitCommands();

            this._isChecked = false;
        }
예제 #3
0
        private void InitMp3SongViewModel(bool paramFileExists, IDialogService paramDialogService)
        {
            MockMp3File      mp3File      = new MockMp3File(InitTitle, InitArtist, InitAlbum);
            MockFileModifier fileModifier = new MockFileModifier(paramFileExists);

            Mp3Song tempMp3Song = new Mp3Song(mp3File, fileModifier);

            this.mp3SongViewModel = new Mp3SongViewModel(tempMp3Song, paramDialogService);
        }
예제 #4
0
        public void DontRenameNotCheckedMp3Songs()
        {
            // Arrange
            const string NewTitleValue = "new title value";

            this.dataGridViewModel.AddWhenNew(this.ExpectedFilePath2);
            IMp3Song mp3Song = new Mp3Song(new MockMp3File(NewTitleValue), new MockFileModifier(false));

            // Act
            Messenger.Default.Send(new NotificationMessage <IMp3Song>(mp3Song, Resources.CommandName_Rename));

            // Assert
            Assert.AreEqual(ExpectedTitle1, this.dataGridViewModel.Mp3SongViewModels[0].Title);
            Assert.AreEqual(ExpectedTitle2, this.dataGridViewModel.Mp3SongViewModels[1].Title);
        }
예제 #5
0
        public void AddWhenNew(string paramFilePath)
        {
            try
            {
                if (!this.IsNewMp3Song(paramFilePath))
                {
                    return;
                }

                Mp3Song          mp3Song          = new Mp3Song(this.modelFactory.CreateMp3File(paramFilePath), this.modelFactory.CreateFileModifier());
                Mp3SongViewModel mp3SongViewModel = new Mp3SongViewModel(mp3Song, this.dialogService);

                this.Mp3SongViewModels.Add(mp3SongViewModel);
            }
            catch (FileException)
            {
                this.dialogService.ShowMessage(Resources.DataGridVM_Exception_Add, string.Format(Resources.DataGridVM_Inner_Exception_Add, paramFilePath));
            }
        }