コード例 #1
0
        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"));
        }
コード例 #2
0
        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"));
        }
コード例 #3
0
        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"));
        }
コード例 #4
0
        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"));
        }
コード例 #5
0
        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"));
        }
コード例 #6
0
        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"));
        }
コード例 #7
0
        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"));
        }