Beispiel #1
0
        public void Check_SpamAction_Tag_Should_Return_String_tag()
        {
            var type = SpamAction.TAG;

            var name = EnumLookup.GetSpamActionName(type);

            Assert.Equal("tag", name);
        }
Beispiel #2
0
        public void Check_SpamAction_Blocked_Should_Return_String_blocked()
        {
            var type = SpamAction.BLOCKED;

            var name = EnumLookup.GetSpamActionName(type);

            Assert.Equal("blocked", name);
        }
Beispiel #3
0
        public void Check_SpamAction_Disabled_Should_Return_String_disabled()
        {
            var type = SpamAction.DISABLED;

            var name = EnumLookup.GetSpamActionName(type);

            Assert.Equal("disabled", name);
        }
Beispiel #4
0
        /// <summary>
        /// Get a json object representation of the domain request object.
        /// </summary>
        /// <returns>Json object</returns>
        public JObject ToJson()
        {
            var jsonObject = new JObject
            {
                ["name"]                 = this.domainName,
                ["smtp_password"]        = this.smtpPassword,
                ["spam_action"]          = EnumLookup.GetSpamActionName(this.spamAction),
                ["wildcard"]             = this.wildcard,
                ["force_dkim_authority"] = this.forceDKIMAuthority
            };

            return(jsonObject);
        }
Beispiel #5
0
        /// <summary>
        /// Get a form content representation of the domain request object.
        /// </summary>
        /// <returns>List of key-value string pairs.</returns>
        public ICollection <KeyValuePair <string, string> > ToFormContent()
        {
            var content = new Collection <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("name", this.domainName),
                new KeyValuePair <string, string>("smtp_password", this.smtpPassword),
                new KeyValuePair <string, string>("spam_action", EnumLookup.GetSpamActionName(this.spamAction)),
                new KeyValuePair <string, string>("wildcard", this.wildcard.ToString().ToLower()),
                new KeyValuePair <string, string>("force_dkim_authority", this.forceDKIMAuthority.ToString().ToLower())
            };

            return(content);
        }