public void Parameter_Method() { Assert.Throws<ArgumentNullException>(() => new GravatarProfileUrlWidget().Parameter(null, new object())); Assert.Throws<ArgumentNullException>(() => new GravatarProfileUrlWidget().Parameter("name", null)); Assert.Throws<ArgumentException>(() => new GravatarProfileUrlWidget().Parameter(string.Empty, new object())); var widget = new GravatarProfileUrlWidget(); Assert.False(widget.Field("parameters").To<IDictionary<string, object>>().Any()); Assert.True(ReferenceEquals(widget.Parameter("name", "value"), widget)); var parameters = widget.Field("parameters").To<IDictionary<string, object>>(); Assert.Equal(1, parameters.Count); Assert.Equal("value", parameters["name"]); }
public void Parameter_Method() { Assert.Throws <ArgumentNullException>(() => new GravatarProfileUrlWidget().Parameter(null, new object())); Assert.Throws <ArgumentNullException>(() => new GravatarProfileUrlWidget().Parameter("name", null)); Assert.Throws <ArgumentException>(() => new GravatarProfileUrlWidget().Parameter(string.Empty, new object())); var widget = new GravatarProfileUrlWidget(); Assert.False(widget.Field("parameters").To <IDictionary <string, object> >().Any()); Assert.True(ReferenceEquals(widget.Parameter("name", "value"), widget)); var parameters = widget.Field("parameters").To <IDictionary <string, object> >(); Assert.Equal(1, parameters.Count); Assert.Equal("value", parameters["name"]); }
public void Constructors() { var widget = new GravatarProfileUrlWidget(); Assert.Null(widget.Hash()); Assert.Null(widget.Format()); Assert.False(widget.Field("parameters").To<IDictionary<string, object>>().Any()); }
public void Constructors() { var widget = new GravatarProfileUrlWidget(); Assert.Null(widget.Hash()); Assert.Null(widget.Format()); Assert.False(widget.Field("parameters").To <IDictionary <string, object> >().Any()); }