Beispiel #1
0
        public void Verify_Test(Type fileSignature, string filename, Type exclusionFs = null)
        {
            using var testStream = TestUtilities.GetResource($"TestRoms.{filename}");
            IFileSignature signature = (IFileSignature)Activator.CreateInstance(fileSignature);

            Assert.True(signature.HeaderSignatureMatches(testStream));

            if (exclusionFs != null)
            {
                IFileSignature exclusion = (IFileSignature)Activator.CreateInstance(exclusionFs);
                Assert.False(exclusion.HeaderSignatureMatches(testStream));
            }
        }
Beispiel #2
0
        public void VerifyStoneProvider_Test(Type fileSignature, string filename)
        {
            using var testStream = TestUtilities.GetResource($"TestRoms.{filename}");
            IFileSignature signature = (IFileSignature)Activator.CreateInstance(fileSignature);

            Assert.True(signature.HeaderSignatureMatches(testStream));

            IStoneProvider stone = new StoneProvider();

            testStream.Seek(0, SeekOrigin.Begin);
            string mimetype = stone.GetStoneMimetype(testStream);

            Assert.NotEqual(String.Empty, mimetype);

            var stoneSigs = stone.GetSignatures(mimetype);

            Assert.Contains(stoneSigs, s => s.HeaderSignatureMatches(testStream));
        }