public void Load()
{
RecentFileList recentFileList = new RecentFileList();
recentFileList.MaxFilesNumber = 3;
recentFileList.AddFile("Doc3");
recentFileList.AddFile("Doc2");
recentFileList.AddFile("Doc1");
AssertHelper.ExpectedException<ArgumentNullException>(() => recentFileList.Load(null));
// Load an empty recent file list
recentFileList.Load(new RecentFile[] { });
Assert.IsFalse(recentFileList.RecentFiles.Any());
recentFileList.Load(new[]
{
new RecentFile("NewDoc1") { IsPinned = true },
new RecentFile("NewDoc2"),
new RecentFile("NewDoc3"),
new RecentFile("NewDoc4")
});
Assert.IsTrue(recentFileList.RecentFiles.Select(f => f.Path).SequenceEqual(new[] { "NewDoc1", "NewDoc2", "NewDoc3" }));
Assert.IsTrue(recentFileList.RecentFiles.Select(f => f.IsPinned).SequenceEqual(new[] { true, false, false }));
}