public void LuigiFormatRom_CheckFormatFromStream_RomFormatIdentifiedCorrectly(string testRomResource, RomFormat expectedRomFormat) { using (var romData = TestRomResources.OpenResourceStream(testRomResource)) { Assert.NotNull(romData); Assert.Equal(expectedRomFormat, LuigiFormatRom.CheckFormat(romData)); } }
public void LuigiFormatRom_GetCrcsFromFileWithZeroCrcs_CrcMatchesCrcOfFile() { var romPath = LuigiFormatRomTestStorageAccess.Initialize(TestRomResources.TestLuigiWithZeroCrcsPath).First(); uint cfgCrc; var crc = LuigiFormatRom.GetCrcs(romPath, null, out cfgCrc); Assert.Equal(TestRomResources.TestLuigiWithZeroCrcsCrc, crc); Assert.Equal(0u, cfgCrc); }
public void LuigiFormatRom_CheckFormatOfCorruptFile_ThrowsNullReferenceException() { IReadOnlyList <string> paths; var storageAccess = LuigiFormatRomTestStorageAccess.Initialize(out paths, TestRomResources.TestLuigiWithBadHeaderPath); var corrupted = storageAccess.IntroduceCorruption(paths.First()); Assert.True(corrupted); Assert.Throws <NullReferenceException>(() => LuigiFormatRom.CheckFormat(paths.First())); }
public void LuigiFormatRom_GetCrcsFromRomOrigin_CrcsMatch() { var romPath = LuigiFormatRomTestStorageAccess.Initialize(TestRomResources.TestLuigiFromRomPath).First(); uint cfgCrc; var crc = LuigiFormatRom.GetCrcs(romPath, null, out cfgCrc); Assert.Equal(TestRomResources.TestRomCrc, crc); Assert.Equal(0u, cfgCrc); }