public void Attach_Method()
 {
   var widget = new VkontakteCommentsWidget();
   Assert.False(widget.Attach().Any());
   Assert.True(ReferenceEquals(widget.Attach("first", "second"), widget));
   Assert.True(widget.Attach().SequenceEqual(new [] { "first", "second" }));
 }
 public void Limit_Method()
 {
   var widget = new VkontakteCommentsWidget();
   Assert.Equal((byte)VkontakteCommentsLimit.Limit5, widget.Limit());
   Assert.True(ReferenceEquals(widget.Limit(1), widget));
   Assert.Equal(1, widget.Limit());
 }
Beispiel #3
0
        public void AutoPublish_Method()
        {
            var widget = new VkontakteCommentsWidget();

            Assert.Null(widget.AutoPublish());
            Assert.True(ReferenceEquals(widget.AutoPublish(true), widget));
            Assert.True(widget.AutoPublish().Value);
        }
Beispiel #4
0
        public void Attach_Method()
        {
            var widget = new VkontakteCommentsWidget();

            Assert.False(widget.Attach().Any());
            Assert.True(ReferenceEquals(widget.Attach("first", "second"), widget));
            Assert.True(widget.Attach().SequenceEqual(new [] { "first", "second" }));
        }
Beispiel #5
0
        public void Limit_Method()
        {
            var widget = new VkontakteCommentsWidget();

            Assert.Equal((byte)VkontakteCommentsLimit.Limit5, widget.Limit());
            Assert.True(ReferenceEquals(widget.Limit(1), widget));
            Assert.Equal(1, widget.Limit());
        }
    public void Width_Method()
    {
      Assert.Throws<ArgumentNullException>(() => new VkontakteCommentsWidget().Width(null));
      Assert.Throws<ArgumentException>(() => new VkontakteCommentsWidget().Width(string.Empty));

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

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

            var widget = new VkontakteCommentsWidget();

            Assert.Null(widget.Width());
            Assert.True(ReferenceEquals(widget.Width("width"), widget));
            Assert.Equal("width", widget.Width());
        }
Beispiel #9
0
        public void ElementId_Method()
        {
            Assert.Throws <ArgumentNullException>(() => new VkontakteCommentsWidget().ElementId(null));
            Assert.Throws <ArgumentException>(() => new VkontakteCommentsWidget().ElementId(string.Empty));

            var widget = new VkontakteCommentsWidget();

            Assert.Null(widget.ElementId());
            Assert.True(ReferenceEquals(widget.ElementId("elementId"), widget));
            Assert.Equal("elementId", widget.ElementId());
        }
 public void Constructors()
 {
   var widget = new VkontakteCommentsWidget();
   Assert.False(widget.Attach().Any());
   Assert.Null(widget.AutoPublish());
   Assert.Null(widget.AutoUpdate());
   Assert.Null(widget.ElementId());
   Assert.Equal((byte)VkontakteCommentsLimit.Limit5, widget.Limit());
   Assert.Null(widget.Mini());
   Assert.Null(widget.Width());
 }
Beispiel #11
0
        public void Constructors()
        {
            var widget = new VkontakteCommentsWidget();

            Assert.False(widget.Attach().Any());
            Assert.Null(widget.AutoPublish());
            Assert.Null(widget.AutoUpdate());
            Assert.Null(widget.ElementId());
            Assert.Equal((byte)VkontakteCommentsLimit.Limit5, widget.Limit());
            Assert.Null(widget.Mini());
            Assert.Null(widget.Width());
        }
Beispiel #12
0
        public void ToHtmlString_Method()
        {
            var html = new VkontakteCommentsWidget().ToString();

            Assert.True(html.Contains(@"<div id=""vk_comments""></div>"));
            Assert.True(html.Contains(@"<script type=""text/javascript"">"));
            Assert.True(html.Contains(@"VK.Widgets.Comments(""vk_comments"", {""limit"":5,""attach"":false});"));

            html = new VkontakteCommentsWidget().Limit(10).Attach(VkontakteCommentsAttach.All).Width("width").AutoPublish(true).AutoUpdate(true).ElementId("elementId").Mini(true).ToString();
            Assert.True(html.Contains(@"<div id=""elementId""></div>"));
            Assert.True(html.Contains(@"<script type=""text/javascript"">"));
            Assert.True(html.Contains(@"VK.Widgets.Comments(""elementId"", {""limit"":10,""attach"":""*"",""width"":""width"",""autoPublish"":1,""norealtime"":0,""mini"":1});"));
        }
 public void AutoUpdate_Method()
 {
   var widget = new VkontakteCommentsWidget();
   Assert.Null(widget.AutoUpdate());
   Assert.True(ReferenceEquals(widget.AutoUpdate(true), widget));
   Assert.True(widget.AutoUpdate().Value);
 }
    public void ToHtmlString_Method()
    {
      var html = new VkontakteCommentsWidget().ToString();
      Assert.True(html.Contains(@"<div id=""vk_comments""></div>"));
      Assert.True(html.Contains(@"<script type=""text/javascript"">"));
      Assert.True(html.Contains(@"VK.Widgets.Comments(""vk_comments"", {""limit"":5,""attach"":false});"));

      html = new VkontakteCommentsWidget().Limit(10).Attach(VkontakteCommentsAttach.All).Width("width").AutoPublish(true).AutoUpdate(true).ElementId("elementId").Mini(true).ToString();
      Assert.True(html.Contains(@"<div id=""elementId""></div>"));
      Assert.True(html.Contains(@"<script type=""text/javascript"">"));
      Assert.True(html.Contains(@"VK.Widgets.Comments(""elementId"", {""limit"":10,""attach"":""*"",""width"":""width"",""autoPublish"":1,""norealtime"":0,""mini"":1});"));
    }
 public void Mini_Method()
 {
   var widget = new VkontakteCommentsWidget();
   Assert.Null(widget.Mini());
   Assert.True(ReferenceEquals(widget.Mini(true), widget));
   Assert.True(widget.Mini().Value);
 }