public void Should_Combine_Paths(string first, string second, string expected) { // Given var path = new DirectoryPath(first); // When var result = path.CombineWithFilePath(new FilePath(second)); // Then Assert.Equal(expected, result.FullPath); }
public void Can_Not_Combine_Directory_Path_With_Absolute_File_Path() { // Given var path = new DirectoryPath("assets"); // When var result = Record.Exception(() => path.CombineWithFilePath(new FilePath("/other/asset.txt"))); // Then Assert.IsType<InvalidOperationException>(result); Assert.Equal("Cannot combine a directory path with an absolute file path.", result.Message); }
public void Should_Throw_If_Path_Is_Null() { // Given var path = new DirectoryPath("assets"); // When var result = Record.Exception(() => path.CombineWithFilePath(null)); // Then Assert.IsType<ArgumentNullException>(result); Assert.Equal("path", ((ArgumentNullException)result).ParamName); }