public void Test0() { using (var tempDirectory = new TempDirectory(true)) { EPuzzlePronuncer.Instance.DirectoryName = tempDirectory.Name; Assert.Null(EPuzzlePronuncer.Instance.FindSoundFile("pronunce")); tempDirectory.AddFile("pronunce.wav", ""); Assert.AreEqual(tempDirectory.GetFullPath("pronunce.wav"), EPuzzlePronuncer.Instance.FindSoundFile("pronunce")); Assert.AreEqual(tempDirectory.GetFullPath("Pronunce.wav"), EPuzzlePronuncer.Instance.FindSoundFile("Pronunce")); } }
public void 新しいグレード指定フォーマット() { using (var tempDirectory = new TempDirectory(true)) { { var manager = new ResultImageManager2(); manager.DirectoryName = tempDirectory.Name; tempDirectory.AddFile(@"A\file0.png", ""); tempDirectory.AddFile(@"x[A]x[B]x\file0.bmp", ""); tempDirectory.AddFile(@"x[AB]x\file2.bmp", ""); CollectionAssert.AreEquivalent(new [] { tempDirectory.GetFullPath(@"A\file0.png"), tempDirectory.GetFullPath(@"x[A]x[B]x\file0.bmp"), tempDirectory.GetFullPath(@"A\file0.png"), tempDirectory.GetFullPath(@"x[A]x[B]x\file0.bmp"), }, new [] { manager.GetFile("A"), manager.GetFile("A"), manager.GetFile("A"), manager.GetFile("A"), }); CollectionAssert.AreEquivalent(new [] { tempDirectory.GetFullPath(@"x[A]x[B]x\file0.bmp"), tempDirectory.GetFullPath(@"x[A]x[B]x\file0.bmp"), }, new [] { manager.GetFile("B"), manager.GetFile("B"), }); } } }
public void 正しい挙動() { using (var tempDirectory = new TempDirectory(true)) { tempDirectory.AddFile(@"A\file0.png", ""); tempDirectory.AddFile(@"A\file1.png", ""); tempDirectory.AddFile(@"A\file2.png", ""); tempDirectory.AddFile(@"B,C,D\file3.png", ""); tempDirectory.AddFile(@"B,C,D\file4.png", ""); tempDirectory.AddFile(@"B,C,D\file5.png", ""); tempDirectory.AddFile(@"C,D\file6.png", ""); tempDirectory.AddFile(@"C,D\file7.png", ""); tempDirectory.AddFile(@"C,D\file8.png", ""); { var manager = new ResultImageManager2(tempDirectory.Name); CollectionAssert.AreEquivalent(new [] { tempDirectory.GetFullPath(@"A\file0.png"), tempDirectory.GetFullPath(@"A\file1.png"), tempDirectory.GetFullPath(@"A\file2.png"), tempDirectory.GetFullPath(@"A\file0.png"), tempDirectory.GetFullPath(@"A\file1.png"), tempDirectory.GetFullPath(@"A\file2.png"), }, new [] { manager.GetFile("A"), manager.GetFile("A"), manager.GetFile("A"), manager.GetFile("A"), manager.GetFile("A"), manager.GetFile("A"), }); } { var manager = new ResultImageManager2(tempDirectory.Name); CollectionAssert.AreEquivalent(new [] { tempDirectory.GetFullPath(@"B,C,D\file3.png"), tempDirectory.GetFullPath(@"B,C,D\file4.png"), tempDirectory.GetFullPath(@"B,C,D\file5.png"), tempDirectory.GetFullPath(@"B,C,D\file3.png"), tempDirectory.GetFullPath(@"B,C,D\file4.png"), tempDirectory.GetFullPath(@"B,C,D\file5.png"), }, new [] { manager.GetFile("B"), manager.GetFile("B"), manager.GetFile("B"), manager.GetFile("B"), manager.GetFile("B"), manager.GetFile("B"), }); } { var manager = new ResultImageManager2(tempDirectory.Name); CollectionAssert.AreEquivalent(new [] { tempDirectory.GetFullPath(@"B,C,D\file3.png"), tempDirectory.GetFullPath(@"B,C,D\file4.png"), tempDirectory.GetFullPath(@"B,C,D\file5.png"), tempDirectory.GetFullPath(@"C,D\file6.png"), tempDirectory.GetFullPath(@"C,D\file7.png"), tempDirectory.GetFullPath(@"C,D\file8.png"), tempDirectory.GetFullPath(@"B,C,D\file3.png"), tempDirectory.GetFullPath(@"B,C,D\file4.png"), tempDirectory.GetFullPath(@"B,C,D\file5.png"), tempDirectory.GetFullPath(@"C,D\file6.png"), tempDirectory.GetFullPath(@"C,D\file7.png"), tempDirectory.GetFullPath(@"C,D\file8.png"), }, new [] { manager.GetFile("C"), manager.GetFile("C"), manager.GetFile("C"), manager.GetFile("C"), manager.GetFile("C"), manager.GetFile("C"), manager.GetFile("C"), manager.GetFile("C"), manager.GetFile("C"), manager.GetFile("C"), manager.GetFile("C"), manager.GetFile("C"), }); } { var manager = new ResultImageManager2(tempDirectory.Name); CollectionAssert.AreEquivalent(new [] { tempDirectory.GetFullPath(@"B,C,D\file3.png"), tempDirectory.GetFullPath(@"B,C,D\file4.png"), tempDirectory.GetFullPath(@"B,C,D\file5.png"), tempDirectory.GetFullPath(@"C,D\file6.png"), tempDirectory.GetFullPath(@"C,D\file7.png"), tempDirectory.GetFullPath(@"C,D\file8.png"), tempDirectory.GetFullPath(@"B,C,D\file3.png"), tempDirectory.GetFullPath(@"B,C,D\file4.png"), tempDirectory.GetFullPath(@"B,C,D\file5.png"), tempDirectory.GetFullPath(@"C,D\file6.png"), tempDirectory.GetFullPath(@"C,D\file7.png"), tempDirectory.GetFullPath(@"C,D\file8.png"), }, new [] { manager.GetFile("D"), manager.GetFile("D"), manager.GetFile("D"), manager.GetFile("D"), manager.GetFile("D"), manager.GetFile("D"), manager.GetFile("D"), manager.GetFile("D"), manager.GetFile("D"), manager.GetFile("D"), manager.GetFile("D"), manager.GetFile("D"), }); } { var manager = new ResultImageManager2(tempDirectory.Name); CollectionAssert.AreEquivalent(new [] { tempDirectory.GetFullPath(@"B,C,D\file3.png"), tempDirectory.GetFullPath(@"B,C,D\file4.png"), tempDirectory.GetFullPath(@"B,C,D\file5.png"), tempDirectory.GetFullPath(@"C,D\file6.png"), tempDirectory.GetFullPath(@"C,D\file7.png"), tempDirectory.GetFullPath(@"C,D\file8.png"), }, new [] { manager.GetFile("B"), manager.GetFile("B"), manager.GetFile("C"), manager.GetFile("C"), manager.GetFile("D"), manager.GetFile("D"), }); } { var manager = new ResultImageManager2(tempDirectory.Name); CollectionAssert.AreEquivalent(new [] { tempDirectory.GetFullPath(@"B,C,D\file3.png"), tempDirectory.GetFullPath(@"B,C,D\file4.png"), tempDirectory.GetFullPath(@"B,C,D\file5.png"), tempDirectory.GetFullPath(@"B,C,D\file3.png"), tempDirectory.GetFullPath(@"B,C,D\file4.png"), tempDirectory.GetFullPath(@"B,C,D\file5.png"), tempDirectory.GetFullPath(@"C,D\file6.png"), tempDirectory.GetFullPath(@"C,D\file7.png"), tempDirectory.GetFullPath(@"C,D\file8.png"), }, new [] { manager.GetFile("B"), manager.GetFile("B"), manager.GetFile("B"), manager.GetFile("B"), manager.GetFile("C"), manager.GetFile("C"), manager.GetFile("D"), manager.GetFile("D"), manager.GetFile("D"), }); } } }
public void Test1() { using (var tempDirectory = new TempDirectory(true)) { { var manager = new ResultImageManager2(); manager.DirectoryName = tempDirectory.Name; tempDirectory.AddFile(@"A\file0.png", ""); tempDirectory.AddFile(@"B\file0.bmp", ""); tempDirectory.AddFile(@"D\file0.txt", ""); manager.PrepareForImages(); CollectionAssert.AreEquivalent(new [] { tempDirectory.GetFullPath(@"A\file0.png"), tempDirectory.GetFullPath(@"B\file0.bmp"), }, manager.Files); Assert.AreEqual(tempDirectory.GetFullPath(@"A\file0.png"), manager.GetFile("A")); CollectionAssert.AreEquivalent(new [] { tempDirectory.GetFullPath(@"B\file0.bmp"), }, manager.Files); Assert.AreEqual(tempDirectory.GetFullPath(@"A\file0.png"), manager.GetFile("A")); Assert.AreEqual(tempDirectory.GetFullPath(@"A\file0.png"), manager.GetFile("A")); Assert.AreEqual(tempDirectory.GetFullPath(@"B\file0.bmp"), manager.GetFile("B")); Assert.AreEqual(tempDirectory.GetFullPath(@"B\file0.bmp"), manager.GetFile("B")); Assert.AreEqual(tempDirectory.GetFullPath(@"B\file0.bmp"), manager.GetFile("B")); Assert.Null(manager.GetFile("C")); Assert.Null(manager.GetFile("C")); Assert.Null(manager.GetFile("C")); Assert.Null(manager.GetFile("D")); Assert.Null(manager.GetFile("D")); Assert.Null(manager.GetFile("D")); tempDirectory.AddFile(@"file3.jpg", ""); /* Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("C")); Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("C")); Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("C")); Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("D")); Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("D")); Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("D")); */ Assert.Null(manager.GetFile("C")); Assert.Null(manager.GetFile("C")); Assert.Null(manager.GetFile("C")); Assert.Null(manager.GetFile("C")); Assert.Null(manager.GetFile("C")); Assert.Null(manager.GetFile("D")); Assert.Null(manager.GetFile("D")); } { var manager = new ResultImageManager2(); manager.DirectoryName = tempDirectory.Name; tempDirectory.AddFile(@"A\file1.png", ""); CollectionAssert.AreEquivalent(new [] { tempDirectory.GetFullPath(@"A\file0.png"), tempDirectory.GetFullPath(@"A\file0.png"), tempDirectory.GetFullPath(@"A\file1.png"), tempDirectory.GetFullPath(@"A\file1.png"), }, new [] { manager.GetFile("A"), manager.GetFile("A"), manager.GetFile("A"), manager.GetFile("A"), }); } } }
public void ResultImageManagerCoreATest() { using (var tempDirectory = new TempDirectory(true)) { { var manager = new ResultImageManagerCoreA(tempDirectory.Name); tempDirectory.AddFile(@"A\file0.png", ""); tempDirectory.AddFile(@"x[A]x[B]x\file0.bmp", ""); tempDirectory.AddFile(@"x[AB]x\file2.bmp", ""); CollectionAssert.AreEquivalent(new [] { tempDirectory.GetFullPath("A"), tempDirectory.GetFullPath("x[A]x[B]x"), }, manager.GetDirectories("A")); CollectionAssert.AreEquivalent(new [] { tempDirectory.GetFullPath(@"A\file0.png"), tempDirectory.GetFullPath(@"x[A]x[B]x\file0.bmp"), }, manager.GetNamesOfImageFilesFromDirectories("A")); Assert.AreEqual("A", manager.GetDirectoryName(tempDirectory.GetFullPath(@"A\file0.png"))); Assert.AreEqual("", manager.GetDirectoryName(tempDirectory.GetFullPath(@"file0.png"))); tempDirectory.AddFile(@"c\file4.png", ""); CollectionAssert.AreEquivalent(new [] { tempDirectory.GetFullPath(@"c\file4.png"), }, manager.GetNamesOfImageFilesFromDirectories("C")); } } }
public void 並び順テスト() { using (var tempDirectory = new TempDirectory(true)) { var manager = new ResultImageManager(); tempDirectory.AddFile(@"A\file0.png", ""); tempDirectory.AddFile(@"A\file1.png", ""); tempDirectory.AddFile(@"A\file2.png", ""); var now = new DateTime(2013, 7, 11, 0, 0, 0); // UTC EPuzzleTime.Now = now; var file0 = tempDirectory.GetFullPath(@"A\file0.png"); var file1 = tempDirectory.GetFullPath(@"A\file1.png"); var file2 = tempDirectory.GetFullPath(@"A\file2.png"); Assert.False(manager.最後に表示してからもっとも時間が経過しているファイルから表示する); manager.DirectoryName = tempDirectory.Name; manager.最後に表示してからもっとも時間が経過しているファイルから表示する = true; Assert.True(manager.最後に表示してからもっとも時間が経過しているファイルから表示する); manager.UpdateAccessTime(file1, now + TimeSpan.FromSeconds(1d)); manager.UpdateAccessTime(file0, now + TimeSpan.FromSeconds(2d)); manager.UpdateAccessTime(file2, now + TimeSpan.FromSeconds(3d)); Assert.AreEqual(file1, manager.GetFile("A")); Assert.AreEqual(file0, manager.GetFile("A")); Assert.AreEqual(file2, manager.GetFile("A")); Assert.AreEqual(file1, manager.GetFile("A")); Assert.AreEqual(file0, manager.GetFile("A")); Assert.AreEqual(file2, manager.GetFile("A")); EPuzzleTime.Now = now + TimeSpan.FromMinutes(1d); manager.UpdateAccessTime(file1); Assert.AreEqual(file0, manager.GetFile("A")); Assert.AreEqual(file2, manager.GetFile("A")); Assert.AreEqual(file1, manager.GetFile("A")); Assert.AreEqual(file0, manager.GetFile("A")); Assert.AreEqual(file2, manager.GetFile("A")); Assert.AreEqual(file1, manager.GetFile("A")); using (var tempFile = new TempFile()) { manager.ImageInfoContainerFileName = tempFile.Name; manager.Save(); var manager2 = new ResultImageManager(); manager2.最後に表示してからもっとも時間が経過しているファイルから表示する = true; manager2.DirectoryName = tempDirectory.Name; manager2.ImageInfoContainerFileName = tempFile.Name; manager2.Load(); Assert.AreEqual(file0, manager2.GetFile("A")); Assert.AreEqual(file2, manager2.GetFile("A")); Assert.AreEqual(file1, manager2.GetFile("A")); } using (var tempFile = new TempFile()) { // 消したファイルの情報は保存しない manager.ImageInfoContainerFileName = tempFile.Name; tempDirectory.DeleteFile(@"A\file1.png"); tempDirectory.DeleteFile(@"A\file2.png"); manager.Save(); var manager2 = new ResultImageManager(); manager2.最後に表示してからもっとも時間が経過しているファイルから表示する = true; manager2.DirectoryName = tempDirectory.Name; manager2.ImageInfoContainerFileName = tempFile.Name; manager2.Load(); var imageInfoContainer = (ImageInfoContainer)TestUtility.GetValue(manager2, "_imageInfoContainer"); Assert.NotNull(imageInfoContainer); Assert.AreEqual(1, imageInfoContainer.ImageInfos.Count()); CollectionAssert.AreEqual(new [] { file0, }, imageInfoContainer.ImageInfos.Keys); } // UpdateAccessTimeにnullなどを渡した場合 Assert.Throws<ArgumentNullException>(() => { manager.UpdateAccessTime(null); }); Assert.Throws<ArgumentException>(() => { manager.UpdateAccessTime(" "); }); Assert.Throws<ArgumentException>(() => { manager.UpdateAccessTime(""); }); } }
public void Test0() { using (var tempDirectory = new TempDirectory(true)) { var manager = new ResultImageManager(); tempDirectory.AddFile(@"A\file0.png", ""); tempDirectory.AddFile(@"B\file0.bmp", ""); tempDirectory.AddFile(@"D\file0.txt", ""); manager.DirectoryName = tempDirectory.Name; Assert.AreEqual(tempDirectory.GetFullPath(@"A\file0.png"), manager.GetFile("A")); Assert.AreEqual(tempDirectory.GetFullPath(@"A\file0.png"), manager.GetFile("A")); Assert.AreEqual(tempDirectory.GetFullPath(@"A\file0.png"), manager.GetFile("A")); Assert.AreEqual(tempDirectory.GetFullPath(@"B\file0.bmp"), manager.GetFile("B")); Assert.AreEqual(tempDirectory.GetFullPath(@"B\file0.bmp"), manager.GetFile("B")); Assert.AreEqual(tempDirectory.GetFullPath(@"B\file0.bmp"), manager.GetFile("B")); Assert.Null(manager.GetFile("C")); Assert.Null(manager.GetFile("C")); Assert.Null(manager.GetFile("C")); Assert.Null(manager.GetFile("D")); Assert.Null(manager.GetFile("D")); Assert.Null(manager.GetFile("D")); tempDirectory.AddFile(@"file3.jpg", ""); Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("C")); Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("C")); Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("C")); Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("D")); Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("D")); Assert.AreEqual(tempDirectory.GetFullPath(@"file3.jpg"), manager.GetFile("D")); tempDirectory.AddFile(@"A\file1.png", ""); manager.Refresh(); CollectionAssert.AreEquivalent(new [] { tempDirectory.GetFullPath(@"A\file0.png"), tempDirectory.GetFullPath(@"A\file0.png"), tempDirectory.GetFullPath(@"A\file1.png"), tempDirectory.GetFullPath(@"A\file1.png"), }, new [] { manager.GetFile("A"), manager.GetFile("A"), manager.GetFile("A"), manager.GetFile("A"), }); manager.Refresh(); var file = manager.GetFile("A", false); Assert.AreEqual(file, manager.GetFile("A", false)); Assert.AreEqual(file, manager.GetFile("A", false)); Assert.AreEqual(file, manager.GetFile("A", false)); Assert.AreEqual(file, manager.GetFile("A", false)); Assert.AreEqual(file, manager.GetFile("A", false)); Assert.AreEqual(file, manager.GetFile("A", false)); } }
public void EPuzzleData2_問題ファイル以外何も用意しない場合のテスト() { using (var tempDirectory = new TempDirectory(true)) { { tempDirectory.AddFile(@"mondai\MondaiDocument.xml", TestResources.Mondai02); tempDirectory.AddFile(@"mondai\MondaiDocument2.xml", TestResources.Mondai03); tempDirectory.AddFile(@"PronunciationInfoContainer.xml", TestResources.PronunciationInfoContainerXml); // 読み込んではいけないファイル tempDirectory.AddFile(@"mondai\help.xml", TestResources.HelpDocumentXml); var data = EPuzzleData.Create(tempDirectory.Value); // ファイルがない場合は作成する Assert.True(File.Exists(data.SettingsFileName)); Assert.AreEqual(tempDirectory.Value, data.DataDir.DirectoryName); CollectionAssert.AreEqual(new [] { "mondaiDocument1", "mondaiDocument2", }, data.MondaiDocuments.Select(x => x.Id)); Assert.AreEqual("User's Name", data.CurrentUserInfo.UserName); Assert.AreEqual("mondaiDocument1", data.CurrentMondaiDocument.Id); Assert.AreEqual("daimon1", data.GetDaimon(data.CurrentMondaiDocument.Id).Id); Assert.False((bool)data.Settings.GetValue("常にカーソルを表示")); data.Settings.SetValue("常にカーソルを表示", true); // data.MondaiDocumentFileNames = new [] { "md.xml", "md2.xml", }; Assert.False(data.カード選択時に音声ファイルを再生する); data.カード選択時に音声ファイルを再生する = true; Assert.AreEqual(data.DataDir.FullPath("help"), data.HelpDirectory); CollectionAssert.AreEqual(new [] { data.DataDir.FullPath(@"help\HelpDocument.xml"), }, data.HelpDocumentFileNames); Assert.AreEqual("ResultImages", data.結果画像のディレクトリ名); // Assert.AreEqual("ResultImages", ResultImageManager.Instance.DirectoryName); Assert.False(data.最後の問題を解いたあと次の画面に遷移しない); Assert.AreEqual("PronunciationInfoContainer.xml", data.発音情報ファイルのパス); data.発音情報ファイルのパス = tempDirectory.GetFullPath("PronunciationInfoContainer.xml"); Assert.NotNull(data.PronunciationInfoContainer); var daimon1 = (Daimon)data.MondaiDocuments[1].GetItem("daimon1"); Assert.AreEqual("mondaiDocument2", daimon1.Parent.Id); Assert.AreEqual("daimon1", daimon1.Id); Assert.AreEqual(2, daimon1.Items.Count()); Assert.False(data.発音問題を有効にする); data.発音問題を有効にする = true; // 発音情報ファイルを設定する tempDirectory.AddFile(@"p.xml", TestResources.PronunciationInfoContainerXml); data.発音情報ファイルのパス = tempDirectory.FullPath(@"p.xml"); CollectionAssert.AreEqual(new [] { "mondaiDocument1", "mondaiDocument2", }, data.家庭教師モードの対象になる問題ファイルのIDの配列); data.家庭教師モードの対象になる問題ファイルのIDの配列 = new [] { "mondai2", "mondai3", }; Assert.AreEqual(TimeSpan.FromHours(12d), data.家庭教師モードにてこの時間以内の問題は無視する); data.家庭教師モードにてこの時間以内の問題は無視する = TimeSpan.FromHours(6d); Assert.AreEqual("ResultImages", data.CurrentUserInfo.ResultImageManager.DirectoryName); Assert.AreEqual(tempDirectory.GetFullPath("ResultImageInfos.dat"), data.ResultImageInfoContainerFileName); // ユーザー情報の保存 Assert.NotNull(data.CurrentUserInfo); data.CurrentUserInfo.MondaiResults.AddNew("id_1", DateTime.MinValue, TimeSpan.FromSeconds(10d)); // 保存する data.Save(); } { tempDirectory.DeleteFile(@"mondai\MondaiDocument.xml"); tempDirectory.DeleteFile(@"mondai\MondaiDocument2.xml"); tempDirectory.AddFile(@"mondai\md.xml", TestResources.Mondai02); tempDirectory.AddFile(@"mondai\md2.xml", TestResources.Mondai03); var data2 = EPuzzleData.Create(tempDirectory.DirectoryName); var mondaiResult = data2.CurrentUserInfo.MondaiResults.First(); Assert.AreEqual("id_1", mondaiResult.MondaiId); Assert.AreEqual(TimeSpan.FromSeconds(10d), mondaiResult.所要時間); // Assert.AreEqual(new [] { "md.xml", "md2.xml" }, data2.MondaiDocumentFileNames); Assert.True((bool)data2.Settings.GetValue("常にカーソルを表示")); Assert.True(data2.カード選択時に音声ファイルを再生する); Assert.False(WindowState.常にカーソルを表示); var window = new EPuzzleWindow(data2); Assert.True(WindowState.常にカーソルを表示); EPuzzleTime.NowObject = new TestNowObject(); EPuzzleTime.Now = DateTime.MinValue; var daimon0 = (Daimon)data2.MondaiDocuments[0].GetItem("daimon3"); data2.CurrentUserInfo.SetLastDaimonInfo(daimon0); EPuzzleTime.Now = DateTime.MinValue + TimeSpan.FromSeconds(1d); var daimon1 = (Daimon)data2.MondaiDocuments[1].GetItem("daimon2"); data2.CurrentUserInfo.SetLastDaimonInfo(daimon1); CollectionAssert.AreEqual(new [] { "mondaiDocument1", "mondaiDocument2", }, data2.CurrentUserInfo.GetLastDaimonInfos().OrderBy(x => x.CreationTime).Select(x => x.DocumentId)); Assert.True(data2.発音問題を有効にする); var daimon2 = data2.GetLastDaimon(); Assert.AreEqual("mondaiDocument2", daimon2.Parent.Id); Assert.AreEqual("daimon2", daimon2.Id); var daimon111 = (Daimon)data2.MondaiDocuments[1].GetItem("daimon1"); Assert.AreEqual("mondaiDocument2", daimon111.Parent.Id); Assert.AreEqual(3, daimon111.Items.OfType<Chumon>().Count()); CollectionAssert.AreEqual(new [] { "mondai2", "mondai3", }, data2.家庭教師モードの対象になる問題ファイルのIDの配列); Assert.AreEqual(TimeSpan.FromHours(6d), data2.家庭教師モードにてこの時間以内の問題は無視する); } } }