Skip to content

Commit

Permalink
fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Sichii committed Jun 3, 2024
1 parent cf4db9b commit eb7f5e8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Tests/Chaos.IO.Tests/FileExTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public void SafeOpenRead_Should_Retry_RetryableExceptions()
var guid = Guid.NewGuid()
.ToString();
var path = $"{guid}.txt";
var tempPath = $"{guid}.temp";
var bakPath = $"{guid}.bak";
var tempPath = $"{guid}.txt.temp";
var bakPath = $"{guid}.txt.bak";
var content = "Temp file content";
File.WriteAllText(path, content);
File.WriteAllText(bakPath, content);
Expand All @@ -49,7 +49,7 @@ public void SafeOpenRead_Should_Retry_RetryableExceptions()
var fileName = Path.GetFileName(stream.Name);

if (fileName == path)
throw new RetryableException();
throw new RetryableException("");

if (fileName == tempPath)
return false;
Expand All @@ -73,7 +73,7 @@ public void SafeOpenRead_Should_ReturnResult_When_MainAndTempFilesMissing_Backup
var guid = Guid.NewGuid()
.ToString();
var path = $"{guid}.txt";
var backPath = $"{guid}.bak";
var backPath = $"{guid}.txt.bak";
var content = "Backup file content";
File.WriteAllText(backPath, content);

Expand Down Expand Up @@ -130,7 +130,7 @@ public void SafeOpenRead_Should_ReturnResult_When_MainFileMissing_TempFileExists
var guid = Guid.NewGuid()
.ToString();
var path = $"{guid}.txt";
var tempPath = $"{guid}.temp";
var tempPath = $"{guid}.txt.temp";
var content = "Temp file content";
File.WriteAllText(tempPath, content);

Expand Down Expand Up @@ -195,8 +195,8 @@ public async Task SafeOpenReadAsync_Should_Retry_RetryableExceptions()
var guid = Guid.NewGuid()
.ToString();
var path = $"{guid}.txt";
var tempPath = $"{guid}.temp";
var bakPath = $"{guid}.bak";
var tempPath = $"{guid}.txt.temp";
var bakPath = $"{guid}.txt.bak";
var content = "Temp file content";
await File.WriteAllTextAsync(path, content);
await File.WriteAllTextAsync(bakPath, content);
Expand All @@ -209,7 +209,7 @@ public async Task SafeOpenReadAsync_Should_Retry_RetryableExceptions()
var fileName = Path.GetFileName(stream.Name);

if (fileName == path)
throw new RetryableException();
throw new RetryableException("");

if (fileName == tempPath)
return Task.FromResult(false);
Expand All @@ -233,7 +233,7 @@ public async Task SafeOpenReadAsync_Should_ReturnResult_When_MainAndTempFilesMis
var guid = Guid.NewGuid()
.ToString();
var path = $"{guid}.txt";
var backPath = $"{guid}.bak";
var backPath = $"{guid}.txt.bak";
var content = "Backup file content";
await File.WriteAllTextAsync(backPath, content);

Expand Down Expand Up @@ -290,7 +290,7 @@ public async Task SafeOpenReadAsync_Should_ReturnResult_When_MainFileMissing_Tem
var guid = Guid.NewGuid()
.ToString();
var path = $"{guid}.txt";
var tempPath = $"{guid}.temp";
var tempPath = $"{guid}.txt.temp";
var content = "Temp file content";
await File.WriteAllTextAsync(tempPath, content);

Expand Down

0 comments on commit eb7f5e8

Please sign in to comment.