public void Verb_Method()
 {
   var widget = new VkontakteLikeButtonWidget();
   Assert.Null(widget.Verb());
   Assert.True(ReferenceEquals(widget.Verb(1), widget));
   Assert.Equal(1, widget.Verb().Value);
 }
Exemple #2
0
        public void Verb_Method()
        {
            var widget = new VkontakteLikeButtonWidget();

            Assert.Null(widget.Verb());
            Assert.True(ReferenceEquals(widget.Verb(1), widget));
            Assert.Equal(1, widget.Verb().Value);
        }
    public void Layout_Method()
    {
      Assert.Throws<ArgumentNullException>(() => new VkontakteLikeButtonWidget().Layout(null));
      Assert.Throws<ArgumentException>(() => new VkontakteLikeButtonWidget().Layout(string.Empty));

      var widget = new VkontakteLikeButtonWidget();
      Assert.Null(widget.Layout());
      Assert.True(ReferenceEquals(widget.Layout("layout"), widget));
      Assert.Equal("layout", widget.Layout());
    }
    public void ElementId_Method()
    {
      Assert.Throws<ArgumentNullException>(() => new VkontakteLikeButtonWidget().ElementId(null));
      Assert.Throws<ArgumentException>(() => new VkontakteLikeButtonWidget().ElementId(string.Empty));

      var widget = new VkontakteLikeButtonWidget();
      Assert.Null(widget.ElementId());
      Assert.True(ReferenceEquals(widget.ElementId("elementId"), widget));
      Assert.Equal("elementId", widget.ElementId());
    }
Exemple #5
0
        public void Width_Method()
        {
            Assert.Throws <ArgumentNullException>(() => new VkontakteLikeButtonWidget().Width(null));
            Assert.Throws <ArgumentException>(() => new VkontakteLikeButtonWidget().Width(string.Empty));

            var widget = new VkontakteLikeButtonWidget();

            Assert.Null(widget.Width());
            Assert.True(ReferenceEquals(widget.Width("width"), widget));
            Assert.Equal("width", widget.Width());
        }
Exemple #6
0
        public void Layout_Method()
        {
            Assert.Throws <ArgumentNullException>(() => new VkontakteLikeButtonWidget().Layout(null));
            Assert.Throws <ArgumentException>(() => new VkontakteLikeButtonWidget().Layout(string.Empty));

            var widget = new VkontakteLikeButtonWidget();

            Assert.Null(widget.Layout());
            Assert.True(ReferenceEquals(widget.Layout("layout"), widget));
            Assert.Equal("layout", widget.Layout());
        }
Exemple #7
0
        public void ElementId_Method()
        {
            Assert.Throws <ArgumentNullException>(() => new VkontakteLikeButtonWidget().ElementId(null));
            Assert.Throws <ArgumentException>(() => new VkontakteLikeButtonWidget().ElementId(string.Empty));

            var widget = new VkontakteLikeButtonWidget();

            Assert.Null(widget.ElementId());
            Assert.True(ReferenceEquals(widget.ElementId("elementId"), widget));
            Assert.Equal("elementId", widget.ElementId());
        }
Exemple #8
0
        public void Image_Method()
        {
            Assert.Throws <ArgumentNullException>(() => new VkontakteLikeButtonWidget().Image(null));
            Assert.Throws <ArgumentException>(() => new VkontakteLikeButtonWidget().Image(string.Empty));

            var widget = new VkontakteLikeButtonWidget();

            Assert.Null(widget.Image());
            Assert.True(ReferenceEquals(widget.Image("image"), widget));
            Assert.Equal("image", widget.Image());
        }
Exemple #9
0
        public void Description_Method()
        {
            Assert.Throws <ArgumentNullException>(() => new VkontakteLikeButtonWidget().Description(null));
            Assert.Throws <ArgumentException>(() => new VkontakteLikeButtonWidget().Description(string.Empty));

            var widget = new VkontakteLikeButtonWidget();

            Assert.Null(widget.Description());
            Assert.True(ReferenceEquals(widget.Description("description"), widget));
            Assert.Equal("description", widget.Description());
        }
Exemple #10
0
        public void ToHtmlString_Method()
        {
            var html = new VkontakteLikeButtonWidget().ToString();

            Assert.True(html.Contains(@"<div id=""vk_like""></div>"));
            Assert.True(html.Contains(@"<script type=""text/javascript"">"));
            Assert.True(html.Contains(@"VK.Widgets.Like(""vk_like"", {});"));

            html = new VkontakteLikeButtonWidget().Layout(VkontakteLikeButtonLayout.Button).ElementId("elementId").Width("width").Title("title").Description("description").Url("url").Image("image").Text("text").Height("height").Verb(1).ToString();
            Assert.True(html.Contains(@"<div id=""elementId""></div>"));
            Assert.True(html.Contains(@"<script type=""text/javascript"">"));
            Assert.True(html.Contains(@"VK.Widgets.Like(""elementId"", {""type"":""button"",""width"":""width"",""pageTitle"":""title"",""pageDescription"":""description"",""pageUrl"":""url"",""pageImage"":""image"",""text"":""text"",""height"":""height"",""verb"":1});"));
        }
 public void Constructors()
 {
   var widget = new VkontakteLikeButtonWidget();
   Assert.Null(widget.ElementId());
   Assert.Null(widget.Text());
   Assert.Null(widget.Verb());
   Assert.Null(widget.Layout());
   Assert.Null(widget.Width());
   Assert.Null(widget.Height());
   Assert.Null(widget.Title());
   Assert.Null(widget.Url());
   Assert.Null(widget.Description());
   Assert.Null(widget.Image());
 }
Exemple #12
0
        public void Constructors()
        {
            var widget = new VkontakteLikeButtonWidget();

            Assert.Null(widget.ElementId());
            Assert.Null(widget.Text());
            Assert.Null(widget.Verb());
            Assert.Null(widget.Layout());
            Assert.Null(widget.Width());
            Assert.Null(widget.Height());
            Assert.Null(widget.Title());
            Assert.Null(widget.Url());
            Assert.Null(widget.Description());
            Assert.Null(widget.Image());
        }
    public void Width_Method()
    {
      Assert.Throws<ArgumentNullException>(() => new VkontakteLikeButtonWidget().Width(null));
      Assert.Throws<ArgumentException>(() => new VkontakteLikeButtonWidget().Width(string.Empty));

      var widget = new VkontakteLikeButtonWidget();
      Assert.Null(widget.Width());
      Assert.True(ReferenceEquals(widget.Width("width"), widget));
      Assert.Equal("width", widget.Width());
    }
    public void ToHtmlString_Method()
    {
      var html = new VkontakteLikeButtonWidget().ToString();
      Assert.True(html.Contains(@"<div id=""vk_like""></div>"));
      Assert.True(html.Contains(@"<script type=""text/javascript"">"));
      Assert.True(html.Contains(@"VK.Widgets.Like(""vk_like"", {});"));

      html = new VkontakteLikeButtonWidget().Layout(VkontakteLikeButtonLayout.Button).ElementId("elementId").Width("width").Title("title").Description("description").Url("url").Image("image").Text("text").Height("height").Verb(1).ToString();
      Assert.True(html.Contains(@"<div id=""elementId""></div>"));
      Assert.True(html.Contains(@"<script type=""text/javascript"">"));
      Assert.True(html.Contains(@"VK.Widgets.Like(""elementId"", {""type"":""button"",""width"":""width"",""pageTitle"":""title"",""pageDescription"":""description"",""pageUrl"":""url"",""pageImage"":""image"",""text"":""text"",""height"":""height"",""verb"":1});"));
    }
    public void Image_Method()
    {
      Assert.Throws<ArgumentNullException>(() => new VkontakteLikeButtonWidget().Image(null));
      Assert.Throws<ArgumentException>(() => new VkontakteLikeButtonWidget().Image(string.Empty));

      var widget = new VkontakteLikeButtonWidget();
      Assert.Null(widget.Image());
      Assert.True(ReferenceEquals(widget.Image("image"), widget));
      Assert.Equal("image", widget.Image());
    }
    public void Description_Method()
    {
      Assert.Throws<ArgumentNullException>(() => new VkontakteLikeButtonWidget().Description(null));
      Assert.Throws<ArgumentException>(() => new VkontakteLikeButtonWidget().Description(string.Empty));

      var widget = new VkontakteLikeButtonWidget();
      Assert.Null(widget.Description());
      Assert.True(ReferenceEquals(widget.Description("description"), widget));
      Assert.Equal("description", widget.Description());
    }