public void ClearMarkedTest() { // Setup the dictionary var dict = new ItemDictionary { ["game-1"] = new ConcurrentList <DatItem> { new Rom { Name = "rom-1", Size = 1024, CRC = "DEADBEEF", SHA1 = "0000000fbbb37f8488100b1b4697012de631a5e6", Machine = new Machine { Name = "game-1" }, }, new Rom { Name = "rom-2", Size = 1024, CRC = "DEADBEEF", SHA1 = "000000e948edcb4f7704b8af85a77a3339ecce44", Machine = new Machine { Name = "game-1" }, Remove = true, }, }, }; dict.ClearMarked(); Assert.Single(dict.Keys); Assert.Single(dict["game-1"]); }