BloomTests.ImageUpdaterTests.UpdateAllHtmlDataAttributesForAllImgElements_HasBothImgAndBackgroundImageElements_UpdatesBoth C# (CSharp) Method

UpdateAllHtmlDataAttributesForAllImgElements_HasBothImgAndBackgroundImageElements_UpdatesBoth() private method

        public void UpdateAllHtmlDataAttributesForAllImgElements_HasBothImgAndBackgroundImageElements_UpdatesBoth()
        {
            var dom = new HtmlDom("<html><body><img src='test.png'/><div style='color:orange; background-image=url(\"test.png\")'/></body></html>");

            using (var folder = new TemporaryFolder("bloom pictures test source"))
            {
                MakeSamplePngImageWithMetadata(folder.Combine("test.png"));
                ImageUpdater.UpdateAllHtmlDataAttributesForAllImgElements(folder.FolderPath, dom, new NullProgress());
            }

            AssertThatXmlIn.Dom(dom.RawDom).HasSpecifiedNumberOfMatchesForXpath("//*[@data-copyright='Copyright 1999 by me']", 2);
            AssertThatXmlIn.Dom(dom.RawDom).HasSpecifiedNumberOfMatchesForXpath("//*[@data-creator='joe']", 2);
            AssertThatXmlIn.Dom(dom.RawDom).HasSpecifiedNumberOfMatchesForXpath("//*[@data-license='cc-by-nd']", 2);
        }