public void should_generate_default_avatar()
        {
            var user = new User();

            var userAvatarService = new UserAvatarService(CreateMockUrlHelper());
            var avatarUrl         = userAvatarService.GetUserAvatarUrl(user);

            Assert.Equal("/assets/default-avatar.jpg", avatarUrl);
        }
        public void should_generate_avatar_from_user_set_avatar()
        {
            var user = new User();

            user.AvatarFileId = 12;

            var userAvatarService = new UserAvatarService(CreateMockUrlHelper(user.AvatarFileId));
            var avatarUrl         = userAvatarService.GetUserAvatarUrl(user);

            Assert.Equal("http://download/12", avatarUrl);
        }
        public void should_generate_by_confirmed_email_address_avatar()
        {
            var user = new User
            {
                EmailAddressConfirmed = true,
                EmailAddress          = "*****@*****.**"
            };

            var userAvatarService = new UserAvatarService(CreateMockUrlHelper());
            var avatarUrl         = userAvatarService.GetUserAvatarUrl(user);

            var hash = Md5Hash(user.EmailAddress);

            Assert.Equal($"https://www.gravatar.com/avatar/{hash}?size=160", avatarUrl);
        }