public void GetAttachmentIdFromPath_WorksForAbsolutePath() { var pwd = Directory.GetCurrentDirectory(); var localDirs = new LocalDirs(pwd); var file = localDirs.GetAttachmentFile(_attachment); var path = localDirs.GetRelativePath(file); localDirs.GetAttachmentIdFromPath(path).ShouldBe(_attachment.Id.ToString()); }
public void GetRelativePath_RemovesWorkingDirectory() { var pwd = Directory.GetCurrentDirectory(); var localDirs = new LocalDirs(pwd); var file = localDirs.GetAttachmentFile(_attachment); var path = localDirs.GetRelativePath(file); path.ShouldContain($"{_s}{_attachment.Id.ToString()}{_s}"); path.ShouldContain($"{_s}{_attachment.Filename}"); var newFile = localDirs.GetFileFromRelativePath(path); newFile.FullName.ShouldBe(file.FullName); }