示例#1
0
        public void IProgramInformationToXmlRomInformationConverter_ConvertInformationWithOneCrc_XmlRomInformationHasExpectedReleaseDateString(string programInfoYear, string expectedYearString)
        {
            var information = new TestProgramInformation()
            {
                Title = "Year tester info", Year = programInfoYear
            };

            information.AddCrcs(1, setVersionMetadata: false);

            var xmlRomInformation = IProgramInformationToXmlRomInformationConverter.Instance.Convert(information).Single();

            Assert.Equal(expectedYearString, xmlRomInformation.GetColumn(XmlRomInformationDatabaseColumnName.release_date).Value);
        }
示例#2
0
        public void IProgramInformationToXmlRomInformationConverter_ConvertInformationWithOneCrc_XmlRomInformationHasExpectedTypeString(GeneralFeatures generalFeatures, string expectedRomTypeString)
        {
            var features    = new ProgramFeaturesBuilder().WithGeneralFeatures(generalFeatures).Build();
            var information = new TestProgramInformation()
            {
                Title = "Rom Type tester info", Features = (ProgramFeatures)features
            };

            information.AddCrcs(1, setVersionMetadata: false);

            var xmlRomInformation = IProgramInformationToXmlRomInformationConverter.Instance.Convert(information, convertAll: false, setFeatures: false, setMetadata: false).Single();

            Assert.Equal(expectedRomTypeString, xmlRomInformation.GetColumn(XmlRomInformationDatabaseColumnName.type).Value);
        }
示例#3
0
        public void IProgramInformationToXmlRomInformationConverter_ConvertInformationWithOneCrc_XmlRomInformationHasExpectedOriginString(ProgramInformationOrigin originToTest, string expectedOriginString)
        {
            var information = new TestProgramInformation()
            {
                Title = "Origin tester info"
            };

            information.SetOrigin(originToTest);
            information.AddCrcs(1, setVersionMetadata: false);

            var xmlRomInformation = IProgramInformationToXmlRomInformationConverter.Instance.Convert(information).Single();

            Assert.Equal(expectedOriginString, xmlRomInformation.GetColumn(XmlRomInformationDatabaseColumnName.origin).Value);
        }
        public void MergedProgramInformationTable_MergedWithNonEmptyTable_HasPrograms()
        {
            var mergedInformationTable = new MergedProgramInformationTable();

            var testProgramInformation = new TestProgramInformation()
            {
                Title = "Marty McTesterson", Features = ProgramFeatures.GetUnrecognizedRomFeatures()
            };

            testProgramInformation.AddCrcs(1);
            var table = new TestProgramInformationTable();

            table.AddEntries(testProgramInformation);
            mergedInformationTable.MergeTable(table);

            Assert.True(mergedInformationTable.Programs.Any());
        }
        public void MergedProgramInformationTable_FindRomWithProgramIdentifier_FindsInformationAsExpected()
        {
            var mergedInformationTable = new MergedProgramInformationTable();
            var testProgramIdentifier  = new ProgramIdentifier(0x123u, 0x456u);
            var testProgramInformation = new TestProgramInformation()
            {
                Title = "Buffy Buckingham", Features = ProgramFeatures.GetUnrecognizedRomFeatures()
            };

            testProgramInformation.AddCrcs(3);
            testProgramInformation.AddCrc(testProgramIdentifier.DataCrc, "Version 0", IncompatibilityFlags.Tutorvision, testProgramIdentifier.OtherData);
            var table = new TestProgramInformationTable();

            table.AddEntries(testProgramInformation);
            mergedInformationTable.MergeTable(table);

            var foundInformation = mergedInformationTable.FindProgram(testProgramIdentifier);

            Assert.NotNull(foundInformation);
        }