Skip to content

Commit

Permalink
Indexer_Test14を追加。
Browse files Browse the repository at this point in the history
  • Loading branch information
shimodateakira committed Sep 9, 2024
1 parent 3f79d18 commit 8caec18
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions AkiraNetwork/VirtualStorageLibrary.Test/VirtualStorageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11031,6 +11031,34 @@ public void Indexer_Test13()
Assert.AreEqual("The specified node [item1] is not of type VirtualDirectory.", ex.Message);
}

[TestMethod]
[TestCategory("Indexer")]
public void Indexer_Test14()
{
// Arrange
VirtualStorage<string> vs = new();

vs["/"] += new VirtualDirectory("dir1");
vs["/dir1"] += new VirtualItem<string>("item1", "Hello, World!");
vs["/dir1"] += new VirtualSymbolicLink("link1", "/dir1/item1"); // #191 ターゲットを相対パスにすると例外。
vs.RefreshLinkDictionary("/dir1/link1");

Debug.WriteLine("\nTree:");
Debug.WriteLine(vs.GenerateTreeDebugText("/"));
Debug.WriteLine($"/dir1/link1(ItemData) = {vs.Item["/dir1/link1"].ItemData}");

Debug.WriteLine("\nLink Dictionary:");
Debug.WriteLine(vs.GenerateLinkTableDebugText());

vs["/"] += new VirtualDirectory("dir2");
vs["/dir2"] = vs["/dir1"];

Debug.WriteLine("\nTree:");
Debug.WriteLine(vs.GenerateTreeDebugText("/"));
Debug.WriteLine($"/dir1/link1(ItemData) = {vs.Item["/dir1/link1"].ItemData}");
Debug.WriteLine($"/dir2/link1(ItemData) = {vs.Item["/dir2/link1"].ItemData}");
}

[TestMethod]
[TestCategory("SetNode")]
public void SetNode_Directory()
Expand Down

0 comments on commit 8caec18

Please sign in to comment.