public void Clearing() { PathRef pathRef = new PathRef("DirA/DirB"); pathRef.Clear(); Assert.That(pathRef.PosixPath, Is.EqualTo("")); }
public void When_UsingClearOnEmptyPath() { PathRef pathRef = new PathRef(); Assert.That(() => { pathRef.Clear(); }, Throws.Nothing); Assert.That(pathRef.IsEmpty, Is.True); Assert.That(pathRef.ToString(), Is.EqualTo("")); }
public void When_UsingClearOnAbsolutePath(string input) { PathRef pathRef = new PathRef(input); Assert.That(() => { pathRef.Clear(); }, Throws.Nothing); Assert.That(pathRef.IsAbsolute, Is.True); Assert.That(pathRef.IsEmpty, Is.False); Assert.That(pathRef.ToString(), Is.EqualTo(@"\")); }
public void When_UsingClearOnNullPath() { PathRef pathRef = new PathRef(null); Assert.That(() => { pathRef.Clear(); }, Throws.Nothing); Assert.That(pathRef.IsNull, Is.True); Assert.That(pathRef.IsEmpty, Is.False); Assert.That(pathRef.ToString(), Is.Null); }
public void When_UsingClearOnRelativePath(string input) { PathRef pathRef = new PathRef(input); Assert.That(() => { pathRef.Clear(); }, Throws.Nothing); Assert.That(pathRef.IsRelative, Is.True); Assert.That(pathRef.IsEmpty, Is.True); Assert.That(pathRef.ToString(), Is.EqualTo("")); }
public void Rooting() { PathRef pathRef = new PathRef("C:/DirA"); Assert.That(pathRef.IsRooted, Is.True); pathRef.JoinWith("../../../.."); Assert.That(pathRef.PosixPath, Is.EqualTo(@"C:")); pathRef.Clear(); Assert.That(pathRef.IsRooted, Is.False); }