Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add SameAs/NotSameAs for file content #53

Merged
merged 3 commits into from
Mar 2, 2025

Conversation

vbreuss
Copy link
Contributor

@vbreuss vbreuss commented Mar 2, 2025

You can now also verify the file content with regard to another file:

IFileSystem fileSystem = new MockFileSystem();
fileSystem.File.WriteAllText("my-file.txt", "some content");
fileSystem.File.WriteAllText("my-other-file.txt", "SOME CONTENT");
fileSystem.File.WriteAllText("my-third-file.txt", "some other content");

await That(fileSystem).HasFile("my-file.txt").WithContent().SameAs("my-other-file.txt").IgnoringCase();
await That(fileSystem).HasFile("my-file.txt").WithContent().NotSameAs("my-third-file.txt");

Verified

This commit was signed with the committer’s verified signature. The key has expired.
juliusknorr Julius Knorr
You can now also verify the file content with regard to another file:

```csharp
IFileSystem fileSystem = new MockFileSystem();
fileSystem.File.WriteAllText("my-file.txt", "some content");
fileSystem.File.WriteAllText("my-other-file.txt", "SOME CONTENT");
fileSystem.File.WriteAllText("my-third-file.txt", "some other content");

await That(fileSystem).HasFile("my-file.txt").WithContent().SameAs("my-other-file.txt").IgnoringCase();
await That(fileSystem).HasFile("my-file.txt").WithContent().NotSameAs("my-third-file.txt");
```
@vbreuss vbreuss added the enhancement New feature or request label Mar 2, 2025
@vbreuss vbreuss self-assigned this Mar 2, 2025
Copy link

github-actions bot commented Mar 2, 2025

🚀 Benchmark Results

Details

BenchmarkDotNet v0.14.0, Ubuntu 24.04.2 LTS (Noble Numbat)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 8.0.406
[Host] : .NET 8.0.13 (8.0.1325.6609), X64 RyuJIT AVX2
DefaultJob : .NET 8.0.13 (8.0.1325.6609), X64 RyuJIT AVX2

Method Mean Error StdDev Gen0 Gen1 Allocated
Dummy_aweXpect 5.348 μs 0.0522 μs 0.0488 μs 0.4425 0.0916 7.3 KB

vbreuss added 2 commits March 2, 2025 12:04
@vbreuss vbreuss enabled auto-merge (squash) March 2, 2025 11:06
@vbreuss vbreuss disabled auto-merge March 2, 2025 11:08
@vbreuss vbreuss merged commit 7cb21ad into main Mar 2, 2025
10 checks passed
@vbreuss vbreuss deleted the topic/add-sameas-content branch March 2, 2025 11:08
Copy link

github-actions bot commented Mar 2, 2025

This is addressed in release v0.8.0.

@github-actions github-actions bot added the state: released The issue is released label Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request state: released The issue is released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compare content of two files
1 participant