public void Ctor_ShouldCreateCmdLet() { var formatPath = new Format_Path(); var cmdlet = formatPath as Cmdlet; Assert.IsTrue(cmdlet != null); }
public void UNCPath_ShouldReturnShortenedPath() { const string testPath = @"\\SERVER\Hello\World"; const string pathToValidate = @"\\S\H\World"; var formatPath = new Format_Path { Path = testPath }; IEnumerator result = formatPath.Invoke().GetEnumerator(); Assert.IsTrue(result.MoveNext()); Assert.IsTrue(result.Current is string); Assert.That(result.Current.ToString(), Is.EqualTo(pathToValidate)); }
public void HomePath_ShouldReturnShortenedPathWithTilde() { string home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); string testPath = Path.Combine(home, @"Hello\World"); const string pathToValidate = @"~\H\World"; var cmd = new Format_Path { Path = testPath }; IEnumerator result = cmd.Invoke().GetEnumerator(); Assert.IsTrue(result.MoveNext()); Assert.IsTrue(result.Current is string); Assert.That(result.Current.ToString(), Is.EqualTo(pathToValidate)); }