Exemple #1
0
        public void IProgramInformation_GetNameForCrcWithNoDescription_ReturnsTitle()
        {
            var information = new TestProgramInformation()
            {
                Title = "Mr. Clean"
            };
            var crc0 = 0xFEDCBA98u;

            Assert.True(information.AddCrc(crc0));
            var crc1 = 0x00112233u;

            Assert.True(information.AddCrc(crc1));

            Assert.Equal(information.Title, information.GetNameForCrc(crc0));
            Assert.Equal(information.Title, information.GetNameForCrc(crc1));
        }
Exemple #2
0
        public void IProgramInformation_GetNameForCrcWithDescription_ReturnsExpectedName()
        {
            var information = new TestProgramInformation()
            {
                Title = "Best Game EVAR!"
            };

            var crc0         = 0x00112233u;
            var description0 = "Penultimate ROM";

            Assert.True(information.AddCrc(crc0, description0));
            var crc1         = 0x44332211u;
            var description1 = "Ultimate ROM";

            Assert.True(information.AddCrc(crc1, description1));

            var name0 = string.Format("{0} ({1})", information.Title, description0);
            var name1 = string.Format("{0} ({1})", information.Title, description1);

            Assert.Equal(name0, information.GetNameForCrc(crc0));
            Assert.Equal(name1, information.GetNameForCrc(crc1));
        }
Exemple #3
0
        public void IProgramInformation_GetNameForCrcWithNoMatches_ThrowsInvalidOperationException()
        {
            var information = new TestProgramInformation()
            {
                Title = "Mr. Clean"
            };
            var crc0 = 0xFEDCBA98u;

            Assert.True(information.AddCrc(crc0));
            var crc1 = 0x00112233u;

            Assert.True(information.AddCrc(crc1));

            Assert.Throws <InvalidOperationException>(() => information.GetNameForCrc(0x11223344u));
        }