public static void Should_Get_Avatar_RoboHash_Image_With_HTTP_When_UseSSL_Is_False()
        {
            string avatar = RoboHash.Image(false);

            Assert.That(avatar,
                        Does.StartWith("http:"));
        }
Пример #2
0
        public static void Should_Throw_Argument_Exception_If_Avatar_RoboHash_Size_Not_Valid()
        {
            var ex = Assert.Throws <ArgumentException>(() => RoboHash.Image(size: "NotValid"));

            Assert.That(ex.Message, Is.StringStarting("Size should be specified in format 300x300"));
            Assert.That(ex.ParamName, Is.EqualTo("size"));
        }
Пример #3
0
        public static void Should_Get_Avatar_RoboHash_Image_With_Default_Values()
        {
            string avatar = RoboHash.Image();

            string expectedFormat = string.Format(IMAGE_FORMAT, "[a-z]+", "png", "300x300", "set1");

            Assert.That(avatar,
                        Is.StringStarting(URL_STARTS_WITH)
                        .And.StringMatching(expectedFormat));
        }
Пример #4
0
        public static void Should_Get_Avatar_RoboHash_Image_With_Custom_Slug()
        {
            string avatar = RoboHash.Image("YOOOOOOOO");

            string expectedFormat = string.Format(IMAGE_FORMAT, "YOOOOOOOO", "png", "300x300", "set1");

            Assert.That(avatar,
                        Is.StringStarting(URL_STARTS_WITH)
                        .And.StringMatching(expectedFormat));
        }
Пример #5
0
        public static void Should_Get_Avatar_RoboHash_Image_With_Custom_Set()
        {
            string avatar = RoboHash.Image(set: "MySet");

            string expectedFormat = string.Format(IMAGE_FORMAT, "[a-z]+", "png", "300x300", "MySet");

            Assert.That(avatar,
                        Is.StringMatching(URL_STARTS_WITH)
                        .And.StringMatching(expectedFormat));
        }
Пример #6
0
        public static void Should_Get_Avatar_RoboHash_Image_With_Custom_Format()
        {
            string avatar = RoboHash.Image(format: RoboHashImageFormat.jpg);

            string expectedFormat = string.Format(IMAGE_FORMAT, "[a-z]+", "jpg", "300x300", "set1");

            Assert.That(avatar,
                        Is.StringStarting(URL_STARTS_WITH)
                        .And.StringMatching(expectedFormat));
        }
Пример #7
0
        public static void Should_Get_Avatar_RoboHash_Image_With_Custom_Size()
        {
            string avatar = RoboHash.Image(size: "200x140");

            string expectedFormat = string.Format(IMAGE_FORMAT, "[a-z]+", "png", "200x140", "set1");

            Assert.That(avatar,
                        Does.StartWith(URL_STARTS_WITH)
                        .And.Match(expectedFormat));
        }
Пример #8
0
        public static void Should_Throw_Argument_Null_Exception_If_Avatar_RoboHash_Set_Is_Null()
        {
            var ex = Assert.Throws <ArgumentNullException>(() => RoboHash.Image(set: null));

            Assert.That(ex.ParamName, Is.EqualTo("set"));
        }