Exemple #1
0
        public void HasDuplicatesTest(bool expected)
        {
            // Setup the dictionary
            var dict = new ItemDictionary
            {
                ["game-1"] = new ConcurrentList <DatItem>
                {
                    new Rom
                    {
                        Name    = "rom-1",
                        Size    = 1024,
                        SHA1    = "0000000fbbb37f8488100b1b4697012de631a5e6",
                        Machine = new Machine {
                            Name = "game-1"
                        },
                    },
                    new Rom
                    {
                        Name    = "rom-2",
                        Size    = 1024,
                        SHA1    = "000000e948edcb4f7704b8af85a77a3339ecce44",
                        Machine = new Machine {
                            Name = "game-1"
                        },
                    },
                },
            };

            var rom = new Rom
            {
                Name    = "rom-1",
                Size    = expected ? 1024 : 2048,
                SHA1    = "0000000fbbb37f8488100b1b4697012de631a5e6",
                Machine = new Machine {
                    Name = "game-1"
                },
            };

            bool actual = dict.HasDuplicates(rom);

            Assert.Equal(expected, actual);
        }