public void NoMessageFilesFound() { var fms = new FileMessageStore(new[] { TestFileFolders.FilesAbsPath }, new[] { Guid.NewGuid().ToString("N") }, Encoding.UTF8); var messageInfos = fms.ScanForMessages().ToList(); Assert.AreEqual(0, messageInfos.Count); fms.SearchFolders = new[] { TestFileFolders.FilesAbsPath + Guid.NewGuid().ToString("N") }; Assert.Throws <DirectoryNotFoundException>(() => messageInfos = fms.ScanForMessages().ToList()); }
public void GetMessageInfosFromFiles() { var fms = new FileMessageStore(new[] { TestFileFolders.FilesAbsPath }, new[] { "Msg*.xml" }, Encoding.UTF8); var messageInfos = fms.ScanForMessages().ToList(); Assert.AreEqual(2, messageInfos.Count); foreach (var info in messageInfos) { // messageInfos come from fast xml scan in MessageInfoBase, Info of the Messsage comes from YAXLib deserialization Assert.AreEqual(info, info.LoadMessage().Info); } }