public void ReturnAmpYouTubeElementWithAttributeDataVideoId() { // Arrange var iframe = this.CreateIFrame(); // Act var actualResult = new YouTubeVideoSanitizer().Sanitize(ElementFactory.Document, iframe); // Assert Assert.AreEqual(VideoId, actualResult.GetAttribute("data-videoid")); }
public void ReturnAmpYouTubeElementWithAttributeLayoutEqualToFill_WhenWidthAndHeightAreNotSpecified() { // Arrange const string ExpectedResult = "fill"; var iframe = this.CreateIFrame(); // Act var actualResult = new YouTubeVideoSanitizer().Sanitize(ElementFactory.Document, iframe); // Assert Assert.AreEqual(ExpectedResult, actualResult.GetAttribute("layout")); }
public void ReturnAmpYouTubeElementWithAttributeLayoutEqualToFixedHeight_WhenOnlyHeighIsSpecified() { // Arrange const string ExpectedResult = "fixed-height"; var iframe = this.CreateIFrame(); iframe.DisplayHeight = 100; // Act var actualResult = new YouTubeVideoSanitizer().Sanitize(ElementFactory.Document, iframe); // Assert Assert.AreEqual(ExpectedResult, actualResult.GetAttribute("layout")); }
public void ReturnAmpYouTubeElementWithAttributeId() { // Arrange const string ExpectedResult = "ytbPlayer"; var iframe = this.CreateIFrame(); iframe.Id = "ytbPlayer"; // Act var actualResult = new YouTubeVideoSanitizer().Sanitize(ElementFactory.Document, iframe); // Assert Assert.AreEqual(ExpectedResult, actualResult.GetAttribute("id")); }
public void ReturnAmpYouTubeElementWithAttributeHeight() { // Arrange const string ExpectedResult = "50"; var iframe = this.CreateIFrame(); iframe.DisplayHeight = 50; // Act var actualResult = new YouTubeVideoSanitizer().Sanitize(ElementFactory.Document, iframe); // Assert Assert.AreEqual(ExpectedResult, actualResult.GetAttribute("height")); }
public void ReturnAmpYouTubeElementWithAttributeLayoutEqualToResponsive_WhenBothWidthAndHeightAreSpecified() { // Arrange const string ExpectedResult = "responsive"; var iframe = this.CreateIFrame(); iframe.DisplayHeight = 100; iframe.DisplayWidth = 100; // Act var actualResult = new YouTubeVideoSanitizer().Sanitize(ElementFactory.Document, iframe); // Assert Assert.AreEqual(ExpectedResult, actualResult.GetAttribute("layout")); }
public void ReturnAmpYouTubeElementWithAttributeLayoutEqualToNoDisplay_WhenTheIframeHasStyleVisibilityHidden() { // Arrange const string ExpectedResult = "nodisplay"; var iframe = this.CreateIFrame(); iframe.DisplayHeight = 100; iframe.SetAttribute("style", "visibility:hidden"); // Act var actualResult = new YouTubeVideoSanitizer().Sanitize(ElementFactory.Document, iframe); // Assert Assert.AreEqual(ExpectedResult, actualResult.GetAttribute("layout")); }