Skip to content

Commit

Permalink
WIP refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
belav committed Dec 6, 2021
1 parent a32bab4 commit 51911dd
Show file tree
Hide file tree
Showing 11 changed files with 418 additions and 280 deletions.
26 changes: 17 additions & 9 deletions Src/CSharpier.Cli.Tests/CliTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ public async Task With_Check_Should_Write_Unformatted_File()
.WithArguments("CheckUnformatted.cs --check")
.ExecuteAsync();

result.Output.Should().StartWith("Warning /CheckUnformatted.cs - Was not formatted.");
result.Output
.Replace("\\", "/")
.Should()
.StartWith("Warning /CheckUnformatted.cs - Was not formatted.");
result.ExitCode.Should().Be(1);
}

Expand Down Expand Up @@ -200,14 +203,19 @@ public async Task Should_Support_Config_With_Multiple_Piped_Files()
.ExecuteAsync();

result.ErrorOutput.Should().BeEmpty();
result.Output
.TrimEnd('\u0003')
.Should()
.Be(
@"var myVariable =
someLongValue;
"
);
result.Output.TrimEnd('\u0003').Should().Be("var myVariable =\n someLongValue;\n");
}

[Test]
public async Task Should_Not_Fail_On_Empty_File()
{
await WriteFileAsync("BasicFile.cs", "");

var result = await new CsharpierProcess().WithArguments(".").ExecuteAsync();

result.Output.Should().StartWith("Total time:");
result.ErrorOutput.Should().BeEmpty();
result.ExitCode.Should().Be(0);
}

private async Task WriteFileAsync(string path, string content)
Expand Down
Loading

0 comments on commit 51911dd

Please sign in to comment.