Exemple #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="originalContentUrl"></param>
 /// <param name="previewImageUrl"></param>
 /// <param name="area"></param>
 /// <param name="externalLink"></param>
 public ImagemapVideo(string originalContentUrl, string previewImageUrl, ImagemapArea area, ExternalLink externalLink)
 {
     OriginalContentUrl = originalContentUrl;
     PreviewImageUrl    = previewImageUrl;
     Area         = area;
     ExternalLink = externalLink;
 }
            public void ShouldThrowExceptionWhenValueBelowZero()
            {
                var area = new ImagemapArea();

                ExceptionAssert.Throws <InvalidOperationException>("The y position should be at least 0.", () =>
                {
                    area.Y = -1;
                });
            }
            public void ShouldThrowExceptionWhenValueIsZero()
            {
                var area = new ImagemapArea();

                ExceptionAssert.Throws <InvalidOperationException>("The width should be at least 1.", () =>
                {
                    area.Width = 0;
                });
            }
        public void Y_BelowZero_ThrowsException()
        {
            ImagemapArea area = new ImagemapArea();

            ExceptionAssert.Throws <InvalidOperationException>("The y position should be at least 0.", () =>
            {
                area.Y = -1;
            });
        }
            public void ShouldThrowExceptionWhenValueIsNegative()
            {
                var area = new ImagemapArea();

                ExceptionAssert.Throws <InvalidOperationException>("The height should be at least 1.", () =>
                {
                    area.Height = -1;
                });
            }
            public void ShouldSetTheProperties()
            {
                var action = new ImagemapArea(1, 2, 3, 4);

                Assert.AreEqual(1, action.X);
                Assert.AreEqual(2, action.Y);
                Assert.AreEqual(3, action.Width);
                Assert.AreEqual(4, action.Height);
            }
Exemple #7
0
            public void ShouldNotThrowExceptionWhenValid()
            {
                var area = new ImagemapArea()
                {
                    Height = 200,
                    Width  = 100
                };

                area.Validate();
            }
Exemple #8
0
            public void ShouldThrowExceptionWhenHeightIsZero()
            {
                var area = new ImagemapArea()
                {
                    Width = 100
                };

                ExceptionAssert.Throws <InvalidOperationException>("The height should be at least 1.", () =>
                {
                    area.Validate();
                });
            }
            public void ShouldThrowExceptionWhenWidthIsZero()
            {
                var area = new ImagemapArea()
                {
                    Height = 200
                };

                ExceptionAssert.Throws <InvalidOperationException>("The width should be at least 1.", () =>
                {
                    ImagemapArea.Convert(area);
                });
            }
        public void Constructor_SerializedCorrectly()
        {
            ImagemapArea area = new ImagemapArea()
            {
                X      = 10,
                Y      = 20,
                Width  = 30,
                Height = 40
            };

            string serialized = JsonConvert.SerializeObject(area);

            Assert.AreEqual(@"{""x"":10,""y"":20,""width"":30,""height"":40}", serialized);
        }
            public void ShouldNotConvertInstanceToNewInstance()
            {
                var area = new ImagemapArea()
                {
                    X      = 1,
                    Y      = 2,
                    Width  = 100,
                    Height = 200
                };

                var imagemapArea = ImagemapArea.Convert(area);

                Assert.AreNotEqual(area, imagemapArea);
            }
            public void ShouldCreateSerializeableObject()
            {
                var area = new ImagemapArea()
                {
                    X      = 10,
                    Y      = 20,
                    Width  = 30,
                    Height = 40
                };

                var serialized = JsonSerializer.SerializeObject(area);

                Assert.AreEqual(@"{""x"":10,""y"":20,""width"":30,""height"":40}", serialized);
            }
Exemple #13
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="area"><see cref="ImagemapArea"/></param>
 /// <param name="text"><see cref="Text"/></param>
 public ImagemapMessageAction(ImagemapArea area, string text)
 {
     Area = area;
     Text = text;
 }
Exemple #14
0
 public ImagemapMessageAction()
 {
     this.type = "message";
     this.area = new ImagemapArea();
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="area"><see cref="ImagemapArea"/></param>
 /// <param name="linkUri"><see cref="LinkUri"/></param>
 public ImagemapUriAction(ImagemapArea area, string linkUri)
 {
     Area    = area;
     LinkUri = linkUri;
 }