public void Constructors()
 {
   var widget = new GravatarImageUrlWidget();
   Assert.Null(widget.Extension());
   Assert.Null(widget.Hash());
   Assert.False(widget.Field("parameters").To<IDictionary<string, object>>().Any());
 }
Exemple #2
0
        public void Constructors()
        {
            var widget = new GravatarImageUrlWidget();

            Assert.Null(widget.Extension());
            Assert.Null(widget.Hash());
            Assert.False(widget.Field("parameters").To <IDictionary <string, object> >().Any());
        }
    public void Hash_Method()
    {
      Assert.Throws<ArgumentNullException>(() => new GravatarImageUrlWidget().Hash(null));
      Assert.Throws<ArgumentException>(() => new GravatarImageUrlWidget().Hash(string.Empty));

      var widget = new GravatarImageUrlWidget();
      Assert.Null(widget.Hash());
      Assert.True(ReferenceEquals(widget.Hash("hash"), widget));
      Assert.Equal("hash", widget.Hash());
    }
    public void Extension_Method()
    {
      Assert.Throws<ArgumentNullException>(() => new GravatarImageUrlWidget().Extension(null));
      Assert.Throws<ArgumentException>(() => new GravatarImageUrlWidget().Extension(string.Empty));

      var widget = new GravatarImageUrlWidget();
      Assert.Null(widget.Extension());
      Assert.True(ReferenceEquals(widget.Extension("extension"), widget));
      Assert.Equal("extension", widget.Extension());
    }
Exemple #5
0
        public void Hash_Method()
        {
            Assert.Throws <ArgumentNullException>(() => new GravatarImageUrlWidget().Hash(null));
            Assert.Throws <ArgumentException>(() => new GravatarImageUrlWidget().Hash(string.Empty));

            var widget = new GravatarImageUrlWidget();

            Assert.Null(widget.Hash());
            Assert.True(ReferenceEquals(widget.Hash("hash"), widget));
            Assert.Equal("hash", widget.Hash());
        }
Exemple #6
0
        public void Extension_Method()
        {
            Assert.Throws <ArgumentNullException>(() => new GravatarImageUrlWidget().Extension(null));
            Assert.Throws <ArgumentException>(() => new GravatarImageUrlWidget().Extension(string.Empty));

            var widget = new GravatarImageUrlWidget();

            Assert.Null(widget.Extension());
            Assert.True(ReferenceEquals(widget.Extension("extension"), widget));
            Assert.Equal("extension", widget.Extension());
        }
    public void Parameter_Method()
    {
      Assert.Throws<ArgumentNullException>(() => new GravatarImageUrlWidget().Parameter(null, new object()));
      Assert.Throws<ArgumentNullException>(() => new GravatarImageUrlWidget().Parameter("name", null));
      Assert.Throws<ArgumentException>(() => new GravatarImageUrlWidget().Parameter(string.Empty, new object()));

      var widget = new GravatarImageUrlWidget();
      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"]);
    }
Exemple #8
0
        public void Parameter_Method()
        {
            Assert.Throws <ArgumentNullException>(() => new GravatarImageUrlWidget().Parameter(null, new object()));
            Assert.Throws <ArgumentNullException>(() => new GravatarImageUrlWidget().Parameter("name", null));
            Assert.Throws <ArgumentException>(() => new GravatarImageUrlWidget().Parameter(string.Empty, new object()));

            var widget = new GravatarImageUrlWidget();

            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"]);
        }