public void IntvFunhouseXmlProgramInformation_GetCrcsWithNullCrcString_ThrowsNullReferenceException()
        {
            var info = new IntvFunhouseXmlProgramInformation();

            Assert.True(string.IsNullOrEmpty(info.CrcString));

            Assert.Throws <NullReferenceException>(() => info.Crcs.Any());
        }
Exemplo n.º 2
0
        public void IProgramInformation_GetDatabaseCodeOnIntvFunhouseXmlProgramInformation_ReturnsExpectedCode()
        {
            var information = new IntvFunhouseXmlProgramInformation()
            {
                Title = "No code for you!", Code = " code "
            };

            Assert.Equal("code", information.GetDatabaseCode());
        }
        public void IntvFunhouseXmlProgramInformation_WithVendorAndPartialExternalInfo_ProducesExpectedContactInformation(string vendor, string expectedContactInfo)
        {
            var externalInfo = "credits/ecs.shtml#Anchor-Mind-28089";
            var info         = new IntvFunhouseXmlProgramInformation()
            {
                ProgramVendor = vendor, ExternalInfo = externalInfo
            };

            Assert.Equal(expectedContactInfo, info.ContactInformation.First());
        }
        public void IntvFunhouseXmlProgramInformation_ToString_PrintsProgramTitle()
        {
            var title = "Gimme Shelter";
            var info  = new IntvFunhouseXmlProgramInformation()
            {
                ProgramTitle = title
            };

            Assert.Equal(title, info.ToString());
        }
        public void IntvFunhouseXmlProgramInformation_WithAbsoluteExternalInfo_ProducesExpectedContactInformation()
        {
            var externalInfo = "https://intvfunhouse.com/games/math.php";
            var info         = new IntvFunhouseXmlProgramInformation()
            {
                ExternalInfo = externalInfo
            };

            Assert.Equal(externalInfo, info.ContactInformation.First());
        }
        public void IntvFunhouseXmlProgramInformation_MultipleMusicContributorEntries_ProducesExpectedMusicContributors()
        {
            var info = new IntvFunhouseXmlProgramInformation()
            {
                ProgramMusic = "||A|b|b|a||"
            };

            var expectedMusic = new[] { "A", "b", "b", "a" };

            Assert.Equal(expectedMusic, info.Music);
        }
        public void IntvFunhouseXmlProgramInformation_WithProgramVendorAndOriginalProgramVendor_VendorReturnsOriginalProgramVendorAsVendor()
        {
            var programVendor  = "Swiper";
            var originalVendor = "No Swiping!";
            var info           = new IntvFunhouseXmlProgramInformation()
            {
                ProgramVendor = programVendor, OriginalProgramVendor = originalVendor
            };

            Assert.Equal(originalVendor, info.Vendor);
        }
        public void IntvFunhouseXmlProgramInformation_SetTitle_HasNoEffect()
        {
            var title = "Intellivision spoken here";
            var info  = new IntvFunhouseXmlProgramInformation()
            {
                ProgramTitle = title
            };

            info.Title = "did it change?";

            Assert.Equal(title, info.Title);
        }
        public void IntvFunhouseXmlProgramInformation_SetShortName_HasNoEffect()
        {
            var title = "No short names";
            var info  = new IntvFunhouseXmlProgramInformation()
            {
                ProgramTitle = title
            };

            info.ShortName = "did it change?";

            Assert.Null(info.ShortName);
        }
        public void IntvFunhouseXmlProgramInformation_SetVendor_HasNoEffect()
        {
            var programVendor = "Scrawny Brawny";
            var info          = new IntvFunhouseXmlProgramInformation()
            {
                ProgramVendor = programVendor
            };

            info.Vendor = "Me! Me! Mi!";

            Assert.Equal(programVendor, info.Vendor);
        }
        public void IntvFunhouseXmlProgramInformation_SetFeatures_UpdatesFeatures()
        {
            var info             = new IntvFunhouseXmlProgramInformation();
            var originalFeatures = info.Features;

            info.Features = ProgramFeatures.GetUnrecognizedRomFeatures();
            var newFeatures = info.Features;

            Assert.NotNull(originalFeatures);
            Assert.NotNull(newFeatures);
            Assert.NotEqual(newFeatures, originalFeatures);
        }
        public void IntvFunhouseXmlProgramInformation_SetOutOfRangeJLPSaveData_FeaturesContainZeroJlpSaveDataSectorCount()
        {
            ushort saveDataSectorCount = JlpFeaturesHelpers.MaxTheoreticalJlpFlashSectorUsage + 1;
            var    info = new IntvFunhouseXmlProgramInformation()
            {
                JLPSaveData = saveDataSectorCount.ToString(CultureInfo.InvariantCulture)
            };

            var features = info.Features;

            Assert.NotNull(features);
            Assert.Equal(0, features.JlpFlashMinimumSaveSectors);
        }
        public void IntvFunhouseXmlProgramInformation_GetCrcsWithNullCfgFiles_ThrowsInvalidOperationException()
        {
            var info = new IntvFunhouseXmlProgramInformation()
            {
                CrcString                  = string.Empty,
                CrcNotesString             = string.Empty,
                CrcIncompatibilitiesString = string.Empty
            };

            Assert.True(string.IsNullOrEmpty(info.CfgFiles));

            Assert.Throws <NullReferenceException>(() => info.Crcs.Any());
        }
        public void IntvFunhouseXmlProgramInformation_SetOverflowSizedJLPSaveData_FeaturesContainZeroJlpSaveDataSectorCount()
        {
            uint saveDataSectorCount = (uint)ushort.MaxValue + 1;
            var  info = new IntvFunhouseXmlProgramInformation()
            {
                JLPSaveData = saveDataSectorCount.ToString(CultureInfo.InvariantCulture)
            };

            var features = info.Features;

            Assert.NotNull(features);
            Assert.Equal(0, features.JlpFlashMinimumSaveSectors);
        }
        public void IntvFunhouseXmlProgramInformation_SetValidJLPSaveData_FeaturesContainCorrectJlpSaveDataSectorCount()
        {
            ushort saveDataSectorCount = 123;
            var    info = new IntvFunhouseXmlProgramInformation()
            {
                JLPSaveData = saveDataSectorCount.ToString(CultureInfo.InvariantCulture)
            };

            var features = info.Features;

            Assert.NotNull(features);
            Assert.Equal(saveDataSectorCount, features.JlpFlashMinimumSaveSectors);
        }
        public void IntvFunhouseXmlProgramInformation_SetYear_UpdatesYear()
        {
            var info = new IntvFunhouseXmlProgramInformation()
            {
                YearString = "1988"
            };

            var newYear = "1999";

            info.Year = newYear;

            Assert.Equal(newYear, info.Year);
        }
Exemplo n.º 17
0
 public TestProgramDescription(IRom rom, string code)
 {
     Rom = rom;
     ProgramInformation = new IntvFunhouseXmlProgramInformation()
     {
         ProgramTitle               = "Tagalong Tod",
         YearString                 = "2000",
         CrcString                  = "0x" + rom.Crc.ToString("x8", CultureInfo.InvariantCulture),
         CrcNotesString             = string.Empty,
         CrcIncompatibilitiesString = string.Empty,
         CfgFiles = "0",
         Code     = code
     };
 }
        public void IntvFunhouseXmlProgramInformation_GetCrcsWithOneCrcAndTwoCfgFiles_ThrowsInvalidOperationException()
        {
            var info = new IntvFunhouseXmlProgramInformation()
            {
                CrcString                  = "0x11223344",
                CrcNotesString             = string.Empty,
                CrcIncompatibilitiesString = string.Empty,
                CfgFiles = "0,1"
            };

            Assert.False(string.IsNullOrEmpty(info.CrcString));
            Assert.False(string.IsNullOrEmpty(info.CfgFiles));

            Assert.Throws <InvalidOperationException>(() => info.Crcs.Any());
        }
        public void IntvFunhouseXmlProgramInformation_GetCrcsWithMalformedCrcIncompatibilitiesString_ReturnsNoIncompatibilities()
        {
            var info = new IntvFunhouseXmlProgramInformation()
            {
                CrcString                  = "0x99887766",
                CrcNotesString             = string.Empty,
                CrcIncompatibilitiesString = "Not a valid number string",
                CfgFiles = "0"
            };

            Assert.False(string.IsNullOrEmpty(info.CrcIncompatibilitiesString));
            Assert.False(string.IsNullOrEmpty(info.CrcString));
            Assert.False(string.IsNullOrEmpty(info.CfgFiles));

            Assert.Equal(IncompatibilityFlags.None, info.Crcs.First().Incompatibilities);
        }
        public void IntvFunhouseXmlProgramInformation_GetCrcsWithAllCrcIncompatibilities_HasAllKnownIncompatibilities(IncompatibilityFlags expectedIncompatibilityFlag)
        {
            var info = new IntvFunhouseXmlProgramInformation()
            {
                CrcString                  = "0x22446688",
                CrcNotesString             = string.Empty,
                CrcIncompatibilitiesString = "ffffffff",
                CfgFiles = "0"
            };

            Assert.False(string.IsNullOrEmpty(info.CrcIncompatibilitiesString));
            Assert.False(string.IsNullOrEmpty(info.CrcString));
            Assert.False(string.IsNullOrEmpty(info.CfgFiles));

            Assert.True(info.Crcs.First().Incompatibilities.HasFlag(expectedIncompatibilityFlag));
        }
        public void IntvFunhouseXmlProgramInformation_WithProgramAndOriginalVendorsAndPartialExternalInfos_ProducesExpectedContactInformation()
        {
            var externalInfo =
                @"        credits/1984b.html#spina
        spina/spina.php";
            var info = new IntvFunhouseXmlProgramInformation()
            {
                ProgramVendor = "Intelligentvision", OriginalProgramVendor = "Mattel Electronics", ExternalInfo = externalInfo
            };

            var expectedContactInfos = new[]
            {
                "http://intellivisionlives.com/bluesky/games/credits/1984b.html#spina",
                "http://intellivision.us/intvgames/spina/spina.php"
            };

            Assert.Equal(expectedContactInfos, info.ContactInformation);
        }
Exemplo n.º 22
0
        public void ProgramDescription_IsMatchingProgramDescriptionWithMatchingProgramIdentifierMatchingRomFormatCfgCrcMustMatchWithCodeInfoHasInfoButDoesNotSupportCode_ReturnsFalse()
        {
            var romPaths    = ProgramDescriptionHelpersTestStorage.Initialize(TestRomResources.TestBinPath, TestRomResources.TestCfgPath);
            var rom         = Rom.Create(romPaths[0], romPaths[1]);
            var code        = "tag";
            var information = new IntvFunhouseXmlProgramInformation()
            {
                ProgramTitle               = "Tagalong Tod",
                YearString                 = "2000",
                CrcString                  = "0x" + rom.Crc.ToString("x8", CultureInfo.InvariantCulture),
                CrcNotesString             = string.Empty,
                CrcIncompatibilitiesString = string.Empty,
                CfgFiles = "0",
                Code     = code
            };
            var description = new ProgramDescription(rom.Crc, rom, information);

            Assert.False(description.IsMatchingProgramDescription(new ProgramIdentifier(rom.Crc, rom.CfgCrc), RomFormat.Bin, cfgCrcMustMatch: true, code: code));
        }
        public void IntvFunhouseXmlProgramInformation_OtherInfoEntriesWithProgramAndOriginalVendors_ProducesExpectedAdditionalInfo()
        {
            var otherInfo =
                @" Additional programming and enhancements: David Harley
   Box and overlay design: Oliver Puschatzki";
            var info = new IntvFunhouseXmlProgramInformation()
            {
                ProgramVendor         = "Intelligentvision",
                OriginalProgramVendor = "Mattel Electronics",
                OtherInfo             = otherInfo
            };

            var expectedAdditionalInformation = new[]
            {
                "Additional programming and enhancements: David Harley",
                "Box and overlay design: Oliver Puschatzki",
                string.Format(CultureInfo.CurrentCulture, Strings.AdditionalVendorInfoWebsite_Format, info.OriginalProgramVendor, "http://intellivisionlives.com/bluesky/games/"),
                string.Format(CultureInfo.CurrentCulture, Strings.AdditionalVendorInfoWebsite_Format, info.ProgramVendor, "http://intellivision.us")
            };

            Assert.Equal(expectedAdditionalInformation, info.AdditionalInformation);
        }
        public void IntvFunhouseXmlProgramInformation_AddCrc_ThrowsInvalidOperationException()
        {
            var info = new IntvFunhouseXmlProgramInformation();

            Assert.Throws <InvalidOperationException>(() => info.AddCrc(0, null, IncompatibilityFlags.None));
        }