public void Mode_Method() { var widget = new VkontakteCommunityWidget(); Assert.Equal((byte)VkontakteCommunityMode.Participants, widget.Mode()); Assert.True(ReferenceEquals(widget.Mode(1), widget)); Assert.Equal(1, widget.Mode()); }
public void ElementId_Method() { Assert.Throws<ArgumentNullException>(() => new VkontakteCommunityWidget().ElementId(null)); Assert.Throws<ArgumentException>(() => new VkontakteCommunityWidget().ElementId(string.Empty)); var widget = new VkontakteCommunityWidget(); Assert.Null(widget.ElementId()); Assert.True(ReferenceEquals(widget.ElementId("elementId"), widget)); Assert.Equal("elementId", widget.ElementId()); }
public void ButtonColor_Method() { Assert.Throws<ArgumentNullException>(() => new VkontakteCommunityWidget().ButtonColor(null)); Assert.Throws<ArgumentException>(() => new VkontakteCommunityWidget().ButtonColor(string.Empty)); var widget = new VkontakteCommunityWidget(); Assert.Null(widget.ButtonColor()); Assert.True(ReferenceEquals(widget.ButtonColor("buttonColor"), widget)); Assert.Equal("buttonColor", widget.ButtonColor()); }
public void Account_Method() { Assert.Throws <ArgumentNullException>(() => new VkontakteCommunityWidget().Account(null)); Assert.Throws <ArgumentException>(() => new VkontakteCommunityWidget().Account(string.Empty)); var widget = new VkontakteCommunityWidget(); Assert.Null(widget.Account()); Assert.True(ReferenceEquals(widget.Account("account"), widget)); Assert.Equal("account", widget.Account()); }
public void ElementId_Method() { Assert.Throws <ArgumentNullException>(() => new VkontakteCommunityWidget().ElementId(null)); Assert.Throws <ArgumentException>(() => new VkontakteCommunityWidget().ElementId(string.Empty)); var widget = new VkontakteCommunityWidget(); Assert.Null(widget.ElementId()); Assert.True(ReferenceEquals(widget.ElementId("elementId"), widget)); Assert.Equal("elementId", widget.ElementId()); }
public void ButtonColor_Method() { Assert.Throws <ArgumentNullException>(() => new VkontakteCommunityWidget().ButtonColor(null)); Assert.Throws <ArgumentException>(() => new VkontakteCommunityWidget().ButtonColor(string.Empty)); var widget = new VkontakteCommunityWidget(); Assert.Null(widget.ButtonColor()); Assert.True(ReferenceEquals(widget.ButtonColor("buttonColor"), widget)); Assert.Equal("buttonColor", widget.ButtonColor()); }
public void Width_Method() { Assert.Throws <ArgumentNullException>(() => new VkontakteCommunityWidget().Width(null)); Assert.Throws <ArgumentException>(() => new VkontakteCommunityWidget().Width(string.Empty)); var widget = new VkontakteCommunityWidget(); Assert.Null(widget.Width()); Assert.True(ReferenceEquals(widget.Width("width"), widget)); Assert.Equal("width", widget.Width()); }
public void Constructors() { var widget = new VkontakteCommunityWidget(); Assert.Null(widget.Account()); Assert.Null(widget.BackgroundColor()); Assert.Null(widget.ButtonColor()); Assert.Null(widget.ElementId()); Assert.Equal((byte)VkontakteCommunityMode.Participants, widget.Mode()); Assert.Null(widget.TextColor()); Assert.Null(widget.Width()); Assert.Null(widget.Height()); }
public void ToHtmlString_Method() { Assert.Equal(string.Empty, new VkontakteCommunityWidget().ToString()); var html = new VkontakteCommunityWidget().Account("account").ToString(); Assert.True(html.Contains(@"<div id=""vk_groups_account""></div>")); Assert.True(html.Contains(@"<script type=""text/javascript"">")); Assert.True(html.Contains(@"VK.Widgets.Group(""vk_groups_account"", {""mode"":0}, ""account"");")); html = new VkontakteCommunityWidget().Account("account").Width("width").Height("height").Mode(VkontakteCommunityMode.News).ElementId("elementId").BackgroundColor("backgroundColor").TextColor("textColor").ButtonColor("buttonColor").ToString(); Assert.True(html.Contains(@"<div id=""elementId""></div>")); Assert.True(html.Contains(@"<script type=""text/javascript"">")); Assert.True(html.Contains(@"VK.Widgets.Group(""elementId"", {""mode"":2,""wide"":1,""width"":""width"",""height"":""height"",""color1"":""backgroundColor"",""color2"":""textColor"",""color3"":""buttonColor""}, ""account"");")); }
public void Account_Method() { Assert.Throws<ArgumentNullException>(() => new VkontakteCommunityWidget().Account(null)); Assert.Throws<ArgumentException>(() => new VkontakteCommunityWidget().Account(string.Empty)); var widget = new VkontakteCommunityWidget(); Assert.Null(widget.Account()); Assert.True(ReferenceEquals(widget.Account("account"), widget)); Assert.Equal("account", widget.Account()); }
public void Width_Method() { Assert.Throws<ArgumentNullException>(() => new VkontakteCommunityWidget().Width(null)); Assert.Throws<ArgumentException>(() => new VkontakteCommunityWidget().Width(string.Empty)); var widget = new VkontakteCommunityWidget(); Assert.Null(widget.Width()); Assert.True(ReferenceEquals(widget.Width("width"), widget)); Assert.Equal("width", widget.Width()); }