public void ReturnsValid_RootPath() { var musicFolder = new MusicFolder("test", true); var newFilePath = musicFolder.MoveFile(CreateFile()).NewFilePath; var folderLocation = MusicFolderLocation.Parse(newFilePath); Assert.True(folderLocation.RootPath.Equals(musicFolder.Path, StringComparison.OrdinalIgnoreCase)); }
public void ReturnsValid_Year() { var musicFolder = new MusicFolder("test", true); var newFilePath = musicFolder.MoveFile(CreateFile()).NewFilePath; var expectedYear = DateTime.Now.Year; var folderLocation = MusicFolderLocation.Parse(newFilePath); Assert.AreEqual(expectedYear, folderLocation.Year); }
public void ReturnsValid_InnerFolderNumber() { var musicFolder = new MusicFolder("test", true); var newFilePath = musicFolder.MoveFile(CreateFile()).NewFilePath; const int expectedInnerFolder = 0; var folderLocation = MusicFolderLocation.Parse(newFilePath); Assert.AreEqual(expectedInnerFolder, folderLocation.InnerFolder); }
public void Add(string path, HashTagModel model, int priority = 0) { Contract.Requires(path != null); Contract.EndContractBlock(); path = PathExtension.Normalize(path); if (!pathMusicFolderDictionary.ContainsKey(path)) { var musicFolder = new MusicFolder(path); pathMusicFolderDictionary[path] = musicFolder; } var pattern = new HashTagModelPattern(model, priority); if (patternFolderDictionary.ContainsKey(pattern)) { throw new PatternAlreadyExistsException(); } patternFolderDictionary.Add(pattern, path); }