public void TestParseInvalidSVGWithCommentOnTop() { Logger logger = new Logger(); logger.SetLogHandler(TestUtils.InitLogHandler()); Dictionary <string, FrameData> allResourceUris = new Dictionary <string, FrameData>(); DomAnalyzer.TextualDataResource tdr = new DomAnalyzer.TextualDataResource() { MimeType = "image/svg+xml", OriginalData = CommonUtils.ReadResourceBytes("Test.Eyes.Sdk.Core.DotNet.Resources.fa-regular-400.svg"), Data = CommonUtils.ReadResourceFile("Test.Eyes.Sdk.Core.DotNet.Resources.fa-regular-400.svg"), Uri = new Uri("https://a.co/fa-regular-400.svg") }; ConcurrentDictionary <string, HashSet <string> > cache = new ConcurrentDictionary <string, HashSet <string> >(); DomAnalyzer.ParseSVG_(tdr, allResourceUris, logger, cache); Assert.AreEqual(0, allResourceUris.Count); }
public void TestParseValidSVGWithLinks() { Logger logger = new Logger(); logger.SetLogHandler(TestUtils.InitLogHandler()); Dictionary <string, FrameData> allResourceUris = new Dictionary <string, FrameData>(); DomAnalyzer.TextualDataResource tdr = new DomAnalyzer.TextualDataResource() { MimeType = "image/svg+xml", OriginalData = CommonUtils.ReadResourceBytes("Test.Eyes.Sdk.Core.DotNet.Resources.applitools_logo_combined.svg"), Data = CommonUtils.ReadResourceFile("Test.Eyes.Sdk.Core.DotNet.Resources.applitools_logo_combined.svg"), Uri = new Uri("https://applitools.github.io/demo/TestPages/VisualGridTestPage/applitools_logo_combined.svg") }; ConcurrentDictionary <string, HashSet <string> > cache = new ConcurrentDictionary <string, HashSet <string> >(); DomAnalyzer.ParseSVG_(tdr, allResourceUris, logger, cache); Assert.AreEqual(3, allResourceUris.Count); }