public void Generic_name_rule_is_valid_when_Username_is_not_equal_to_AutorName()
        {
            var nameRule = classMetadata.Rules
                .OfType<GenericClassRule<WebUser>>()
                .Single();

            var webUser = new WebUser();
            webUser.Username = "******";
            webUser.Autor = new Autor { Name = "Albert" };

            Assert.True(nameRule.IsValid(webUser));
        }
        public void Generic_bounceCount_rule_is_valid_when_email_has_bounced_twice()
        {
            var bounceCountRule = bounceCount.Rules
                .OfType<GenericRule<int>>()
                .Single();
            var webUser = new WebUser();

            webUser.MailHasBounced();
            webUser.MailHasBounced();

            Assert.True(bounceCountRule.IsValid(webUser.BounceCount));
        }
        public void Generic_name_rule_is_invalid_when_Username_is_equal_to_AutorName()
        {
            var nameRule = classMetadata.Rules
                .OfType<GenericClassRule<WebUser>>()
                .Single();

            var webUser = new WebUser();
            webUser.Username = "******";
            webUser.Autor = new Autor { Name = "Holger" };

            Console.WriteLine(nameRule.FormatErrorMessage(classMetadata.GetDisplayName()));
            Assert.False(nameRule.IsValid(webUser));
        }
        public void Generic_bounceCount_rule_is_invalid_when_email_has_bounced_thrice()
        {
            var bounceCountRule = bounceCount.Rules
                .OfType<GenericRule<int>>()
                .Single();
            var webUser = new WebUser();

            webUser.MailHasBounced();
            webUser.MailHasBounced();
            webUser.MailHasBounced();

            Console.WriteLine(bounceCountRule.FormatErrorMessage(bounceCount.GetDisplayName()));
            Assert.False(bounceCountRule.IsValid(webUser.BounceCount));
        }