public void TwoPathSegmentsIncludeFileAndOneParentDirectory() { // Arrange var service = new FilePathService(); // Act var path = service.ReducePath(@"C:\Three\Two\One.txt", 2); // Assert Assert.That(path, Is.EqualTo(@"Two\One.txt")); }
public void OnePathSegmentIncludesFileOnly() { // Arrange var service = new FilePathService(); // Act var path = service.ReducePath(@"C:\Three\Two\One.txt", 1); // Assert Assert.That(path, Is.EqualTo(@"One.txt")); }
public void FullNameIsReturnedIfPathSegmentCountIsGreaterThanSegmentsInFullName() { // Arrange const string fullName = @"C:\Three\Two\One.txt"; var service = new FilePathService(); // Act var path = service.ReducePath(fullName, 9); // Assert Assert.That(path, Is.EqualTo(fullName)); }