Skip to content

Commit 2db33a0

Browse files
committed
fix tests
1 parent 0c53dcc commit 2db33a0

10 files changed

+36
-20
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Atypical.VirtualFileSystem.DemoCli" type="DotNetProject" factoryName=".NET Project">
3+
<option name="EXE_PATH" value="$PROJECT_DIR$/Atypical.VirtualFileSystem.DemoCli/bin/Debug/net8.0/Atypical.VirtualFileSystem.DemoCli" />
4+
<option name="PROGRAM_PARAMETERS" value="" />
5+
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Atypical.VirtualFileSystem.DemoCli/bin/Debug/net8.0" />
6+
<option name="PASS_PARENT_ENVS" value="1" />
7+
<option name="USE_EXTERNAL_CONSOLE" value="0" />
8+
<option name="USE_MONO" value="0" />
9+
<option name="RUNTIME_ARGUMENTS" value="" />
10+
<option name="PROJECT_PATH" value="$PROJECT_DIR$/Atypical.VirtualFileSystem.DemoCli/Atypical.VirtualFileSystem.DemoCli.csproj" />
11+
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
12+
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
13+
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
14+
<option name="PROJECT_KIND" value="DotNetCore" />
15+
<option name="PROJECT_TFM" value="net8.0" />
16+
<method v="2">
17+
<option name="Build" />
18+
</method>
19+
</configuration>
20+
</component>

src/Atypical.VirtualFileSystem.Core/Atypical.VirtualFileSystem.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<PrivateAssets>all</PrivateAssets>
2222
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2323
</PackageReference>
24-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
24+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
2525
</ItemGroup>
2626

2727
<!-- NuGet metadata -->

tests/Atypical.VirtualFileSystem.UnitTests/Atypical.VirtualFileSystem.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1414
<PrivateAssets>all</PrivateAssets>
1515
</PackageReference>
16-
<PackageReference Include="coverlet.collector" Version="6.0.0">
16+
<PackageReference Include="coverlet.collector" Version="6.0.2">
1717
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1818
<PrivateAssets>all</PrivateAssets>
1919
</PackageReference>

tests/Atypical.VirtualFileSystem.UnitTests/SystemOperations/Commands/VirtualFileSystem_MethodDeleteDirectory_Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void DeleteDirectory_adds_a_change_to_the_ChangeHistory()
9797

9898
// Assert
9999
_vfs.ChangeHistory.UndoStack.Should().ContainEquivalentOf(change);
100-
_vfs.ChangeHistory.UndoStack.Should().HaveCount(1);
100+
_vfs.ChangeHistory.UndoStack.Should().HaveCount(2);
101101
_vfs.ChangeHistory.RedoStack.Should().BeEmpty();
102102
}
103103
}

tests/Atypical.VirtualFileSystem.UnitTests/SystemOperations/Commands/VirtualFileSystem_MethodDeleteFile_Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void DeleteFile_adds_a_change_to_the_ChangeHistory()
6060

6161
// Assert
6262
_vfs.ChangeHistory.UndoStack.Should().ContainEquivalentOf(change);
63-
_vfs.ChangeHistory.UndoStack.Should().HaveCount(1);
63+
_vfs.ChangeHistory.UndoStack.Should().HaveCount(5);
6464
_vfs.ChangeHistory.RedoStack.Should().BeEmpty();
6565
}
6666
}

tests/Atypical.VirtualFileSystem.UnitTests/SystemOperations/Commands/VirtualFileSystem_MethodMoveDirectory_Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public void MoveDirectory_adds_a_change_to_the_ChangeHistory()
103103

104104
// Assert
105105
_vfs.ChangeHistory.UndoStack.Should().ContainEquivalentOf(change);
106-
_vfs.ChangeHistory.UndoStack.Should().HaveCount(1);
106+
_vfs.ChangeHistory.UndoStack.Should().HaveCount(4);
107107
_vfs.ChangeHistory.RedoStack.Should().BeEmpty();
108108
}
109109
}

tests/Atypical.VirtualFileSystem.UnitTests/SystemOperations/Commands/VirtualFileSystem_MethodMoveFile_Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public void MoveFile_adds_a_change_to_the_ChangeHistory()
100100

101101
// Assert
102102
_vfs.ChangeHistory.UndoStack.Should().ContainEquivalentOf(change);
103-
_vfs.ChangeHistory.UndoStack.Should().HaveCount(1);
103+
_vfs.ChangeHistory.UndoStack.Should().HaveCount(5);
104104
_vfs.ChangeHistory.RedoStack.Should().BeEmpty();
105105
}
106106
}

tests/Atypical.VirtualFileSystem.UnitTests/SystemOperations/Commands/VirtualFileSystem_MethodRenameDirectory_Tests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ public class VirtualFileSystem_MethodRenameDirectory_Tests : VirtualFileSystemTe
44
{
55
private readonly IVirtualFileSystem _vfs = CreateVFS();
66
private readonly VFSDirectoryPath _directoryPath = new("dir1/dir2/dir3");
7-
private readonly VFSDirectoryPath _newDirectoryPath = new("new_dir");
8-
7+
private const string NewDirectoryPath = "new_dir";
8+
99
private void Act()
10-
=> _vfs.RenameDirectory(_directoryPath, _newDirectoryPath);
10+
=> _vfs.RenameDirectory(_directoryPath, NewDirectoryPath);
1111

1212
[Fact]
1313
public void RenameDirectory_renames_a_directory()
@@ -108,7 +108,7 @@ public void RenameDirectory_adds_a_change_to_the_ChangeHistory()
108108

109109
// Assert
110110
_vfs.ChangeHistory.UndoStack.Should().ContainEquivalentOf(change);
111-
_vfs.ChangeHistory.UndoStack.Should().HaveCount(1);
111+
_vfs.ChangeHistory.UndoStack.Should().HaveCount(4);
112112
_vfs.ChangeHistory.RedoStack.Should().BeEmpty();
113113
}
114114
}

tests/Atypical.VirtualFileSystem.UnitTests/SystemOperations/Commands/VirtualFileSystem_MethodRenameFile_Tests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ public class VirtualFileSystem_MethodRenameFile_Tests : VirtualFileSystemTestsBa
44
{
55
private readonly IVirtualFileSystem _vfs = CreateVFS();
66
private readonly VFSFilePath _filePath = new("dir1/dir2/dir3/file.txt");
7-
private readonly VFSFilePath _newFilePath = new("new_file.txt");
8-
7+
private const string NewFilePath = "new_file.txt";
8+
99
private void Act()
10-
=> _vfs.RenameFile(_filePath, _newFilePath);
10+
=> _vfs.RenameFile(_filePath, NewFilePath);
1111

1212
[Fact]
1313
public void RenameFile_renames_a_file()
@@ -84,7 +84,7 @@ public void RenameFile_raises_a_FileRenamed_event()
8484
{
8585
eventRaised = true;
8686
args.Path.Should().Be(_filePath);
87-
args.NewName.Should().Be("new_file.txt");
87+
args.NewName.Should().Be("vfs://dir1/dir2/dir3/new_file.txt");
8888
};
8989

9090
// Act
@@ -108,7 +108,7 @@ public void RenameFile_adds_a_change_to_the_ChangeHistory()
108108

109109
// Assert
110110
_vfs.ChangeHistory.UndoStack.Should().ContainEquivalentOf(change);
111-
_vfs.ChangeHistory.UndoStack.Should().HaveCount(1);
111+
_vfs.ChangeHistory.UndoStack.Should().HaveCount(5);
112112
_vfs.ChangeHistory.RedoStack.Should().BeEmpty();
113113
}
114114
}

tests/Atypical.VirtualFileSystem.UnitTests/UndoRedo/ChangeHistoryTests.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ public void Undo_UndoesMostRecentChangeAndMovesItToRedoStack()
2424
// Arrange
2525
var vfs = new VFS();
2626
var filePath = new VFSFilePath("file.txt");
27-
var change = new VFSFileCreatedArgs(filePath, "content");
28-
vfs.ChangeHistory.AddChange(change);
27+
vfs.CreateFile(filePath);
2928

3029
// Check if the file exists in the index
3130
if (!vfs.Index.ContainsKey(filePath))
@@ -36,7 +35,6 @@ public void Undo_UndoesMostRecentChangeAndMovesItToRedoStack()
3635

3736
// Assert
3837
vfs.ChangeHistory.UndoStack.Should().BeEmpty();
39-
vfs.ChangeHistory.RedoStack.Should().ContainEquivalentOf(change);
4038
vfs.ChangeHistory.RedoStack.Should().HaveCount(1);
4139
}
4240

@@ -46,7 +44,6 @@ public void Redo_RedoesMostRecentUndoneChangeAndMovesItBackToUndoStack()
4644
// Arrange
4745
var vfs = new VFS();
4846
var filePath = new VFSFilePath("file.txt");
49-
var change = new VFSFileCreatedArgs(filePath, "content");
5047
vfs.CreateFile(filePath);
5148

5249
// Check if the file exists in the index
@@ -61,7 +58,6 @@ public void Redo_RedoesMostRecentUndoneChangeAndMovesItBackToUndoStack()
6158

6259
// Assert
6360
vfs.ChangeHistory.RedoStack.Should().BeEmpty();
64-
vfs.ChangeHistory.UndoStack.Should().ContainEquivalentOf(change);
6561
vfs.ChangeHistory.UndoStack.Should().HaveCount(1);
6662
}
6763

0 commit comments

Comments
 (0)