Skip to content

Commit 9c7a071

Browse files
committed
Cleanup
1 parent 52d6ee0 commit 9c7a071

File tree

12 files changed

+20
-95
lines changed

12 files changed

+20
-95
lines changed

Testably.Abstractions.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
6060
ProjectSection(SolutionItems) = preProject
6161
.github\workflows\build.yml = .github\workflows\build.yml
6262
.github\workflows\ci.yml = .github\workflows\ci.yml
63+
.github\workflows\test-report.yml = .github\workflows\test-report.yml
6364
EndProjectSection
6465
EndProject
6566
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testably.Abstractions.Parity.Tests", "Tests\Testably.Abstractions.Parity.Tests\Testably.Abstractions.Parity.Tests.csproj", "{E9A42D82-0609-4D6B-B270-A30176B4FCF2}"

Tests/Testably.Abstractions.Tests/FileSystem/Directory/DeleteTests.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,12 @@ public void Delete_Recursive_WithOpenFile_ShouldThrowIOException_OnWindows(
109109
.WithSubdirectory(path);
110110
string filePath = FileSystem.Path.Combine(path, filename);
111111
FileSystemStream openFile = FileSystem.File.OpenWrite(filePath);
112-
openFile.Write([
113-
0
114-
], 0, 1);
112+
openFile.Write([0], 0, 1);
115113
openFile.Flush();
116114
Exception? exception = Record.Exception(() =>
117115
{
118116
FileSystem.Directory.Delete(path, true);
119-
openFile.Write([
120-
0
121-
], 0, 1);
117+
openFile.Write([0], 0, 1);
122118
openFile.Flush();
123119
});
124120

Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/DeleteTests.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,13 @@ public void Delete_Recursive_WithOpenFile_ShouldThrowIOException_OnWindows(
3232
.WithSubdirectory(path);
3333
string filePath = FileSystem.Path.Combine(path, filename);
3434
FileSystemStream openFile = FileSystem.File.OpenWrite(filePath);
35-
openFile.Write([
36-
0
37-
], 0, 1);
35+
openFile.Write([0], 0, 1);
3836
openFile.Flush();
3937
IDirectoryInfo sut = FileSystem.DirectoryInfo.New(path);
4038
Exception? exception = Record.Exception(() =>
4139
{
4240
sut.Delete(true);
43-
openFile.Write([
44-
0
45-
], 0, 1);
41+
openFile.Write([0], 0, 1);
4642
openFile.Flush();
4743
});
4844

Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesAsyncTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,7 @@ public async Task AppendAllLinesAsync_NullEncoding_ShouldThrowArgumentNullExcept
122122
[AutoData]
123123
public async Task AppendAllLinesAsync_ShouldEndWithNewline(string path)
124124
{
125-
string[] contents =
126-
[
127-
"foo", "bar"
128-
];
125+
string[] contents = ["foo", "bar"];
129126
string expectedResult = "foo" + Environment.NewLine + "bar" + Environment.NewLine;
130127

131128
await FileSystem.File.AppendAllLinesAsync(path, contents);

Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllLinesTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,7 @@ public void AppendAllLines_NullEncoding_ShouldThrowArgumentNullException(
7272
[AutoData]
7373
public void AppendAllLines_ShouldEndWithNewline(string path)
7474
{
75-
string[] contents =
76-
[
77-
"foo", "bar"
78-
];
75+
string[] contents = ["foo", "bar"];
7976
string expectedResult = "foo" + Environment.NewLine + "bar" + Environment.NewLine;
8077

8178
FileSystem.File.AppendAllLines(path, contents);

Tests/Testably.Abstractions.Tests/FileSystem/File/AppendAllTextTests.cs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,7 @@ public void AppendAllText_MissingFile_ShouldCreateFile(
5252
public void AppendAllText_MissingFile_ShouldCreateFileWithByteOrderMark(
5353
string path)
5454
{
55-
byte[] expectedBytes =
56-
[
57-
255,
58-
254,
59-
0,
60-
0,
61-
65,
62-
0,
63-
0,
64-
0,
65-
65,
66-
0,
67-
0,
68-
0
69-
];
55+
byte[] expectedBytes = [255, 254, 0, 0, 65, 0, 0, 0, 65, 0, 0, 0];
7056

7157
FileSystem.File.AppendAllText(path, "AA", Encoding.UTF32);
7258

Tests/Testably.Abstractions.Tests/FileSystem/File/DeleteTests.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,12 @@ public void Delete_WithOpenFile_ShouldThrowIOException_OnWindows(string filename
4141
{
4242
FileSystem.Initialize();
4343
FileSystemStream openFile = FileSystem.File.OpenWrite(filename);
44-
openFile.Write([
45-
0
46-
], 0, 1);
44+
openFile.Write([0], 0, 1);
4745
openFile.Flush();
4846
Exception? exception = Record.Exception(() =>
4947
{
5048
FileSystem.File.Delete(filename);
51-
openFile.Write([
52-
0
53-
], 0, 1);
49+
openFile.Write([0], 0, 1);
5450
openFile.Flush();
5551
});
5652

Tests/Testably.Abstractions.Tests/FileSystem/File/ReadAllLinesTests.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ public void ReadAllLines_ShouldEnumerateLines(string path, string[] lines)
5050
[AutoData]
5151
public void ReadAllLines_ShouldNotReturnByteOrderMark(string path, string content)
5252
{
53-
FileSystem.File.WriteAllLines(path, [
54-
content
55-
], Encoding.UTF32);
53+
FileSystem.File.WriteAllLines(path, [content], Encoding.UTF32);
5654

5755
string[] result = FileSystem.File.ReadAllLines(path, Encoding.UTF32);
5856

Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextAsyncTests.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,7 @@ public async Task WriteAllTextAsync_ShouldCreateFileWithText(
7070
public async Task WriteAllTextAsync_SpecialCharacters_ShouldReturnSameText(
7171
string path)
7272
{
73-
char[] specialCharacters =
74-
[
75-
'Ä',
76-
'Ö',
77-
'Ü',
78-
'ä',
79-
'ö',
80-
'ü',
81-
'ß'
82-
];
73+
char[] specialCharacters = ['Ä', 'Ö', 'Ü', 'ä', 'ö', 'ü', 'ß'];
8374
foreach (char specialCharacter in specialCharacters)
8475
{
8576
string contents = "_" + specialCharacter;

Tests/Testably.Abstractions.Tests/FileSystem/File/WriteAllTextTests.cs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,7 @@ public void WriteAllText_ShouldAdjustTimes(string path, string contents)
7777
public void WriteAllText_ShouldCreateFileWithByteOrderMark(
7878
string path)
7979
{
80-
byte[] expectedBytes =
81-
[
82-
255,
83-
254,
84-
0,
85-
0,
86-
65,
87-
0,
88-
0,
89-
0,
90-
65,
91-
0,
92-
0,
93-
0
94-
];
80+
byte[] expectedBytes = [255, 254, 0, 0, 65, 0, 0, 0, 65, 0, 0, 0];
9581

9682
FileSystem.File.WriteAllText(path, "AA", Encoding.UTF32);
9783

0 commit comments

Comments
 (0)