Example #1
0
        public void ShouldNotHaveSameItemTwice()
        {
            SoundHolder   sh  = new SoundHolder();
            SoundItemData sid = new SoundItemData
            {
                Name     = "Added item",
                FullPath = @"C:\FullPath\Wav.wav"
            };

            sh.Add(sid);

            SoundItemData sidTwo = new SoundItemData
            {
                Name     = "Added item Different name",
                FullPath = @"C:\FullPath\Wav.wav"
            };

            sh.Add(sidTwo);

            sh.SoundItems.Should().HaveCount(1);
            sh.SoundItems[0].Name.Should().Be("Added item");
        }
Example #2
0
        public void ShouldAddItemToList()
        {
            SoundHolder   sh  = new SoundHolder();
            SoundItemData sid = new SoundItemData
            {
                Name = "Added item"
            };

            sh.Add(sid);

            sh.SoundItems.Should().HaveCount(1);
            sh.SoundItems[0].Name.Should().Be("Added item");
        }
        private void Search_Click(object sender, RoutedEventArgs e)
        {
            List <string> files = FileSearchHelper.GetAllFiles();

            foreach (string name in files)
            {
                SoundItemData sid = new SoundItemData();
                sid.Name     = Path.GetFileNameWithoutExtension(name);
                sid.FullPath = name;
                _soundHolder.Add(sid);
            }
            _soundHolder.SaveIfNeeded();
            PopulateSoundItemList();

            ConvertTagsToList();
        }