public void DoWhoisLookupTest()
 {
     YoungDomainSpamAgent_Accessor target = new YoungDomainSpamAgent_Accessor(); // TODO: Initialize to an appropriate value
     string strDomain = "twitter.com"; // TODO: Initialize to an appropriate value
     string strResponse = string.Empty; // TODO: Initialize to an appropriate value
     target.DoWhoisLookup(strDomain, out strResponse);
     Assert.AreNotEqual(string.Empty, strResponse);
 }
        public void GetTLDTest()
        {
            YoungDomainSpamAgent_Accessor target = new YoungDomainSpamAgent_Accessor(); // TODO: Initialize to an appropriate value
            string domain_name = "copperstone.co.uk"; // TODO: Initialize to an appropriate value
            string expected = "co.uk"; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.GetTLD(domain_name);
            Assert.AreEqual(expected, actual);

            domain_name = "metropark.com"; // TODO: Initialize to an appropriate value
            expected = "com"; // TODO: Initialize to an appropriate value
            actual = "";
            actual = target.GetTLD(domain_name);
            Assert.AreEqual(expected, actual);
        }
        public void GetAgeFromWhoisDataTest()
        {
            YoungDomainSpamAgent_Accessor target = new YoungDomainSpamAgent_Accessor(); // TODO: Initialize to an appropriate value

            System.IO.DirectoryInfo di = new System.IO.DirectoryInfo("../../../whois_samples");
            System.IO.FileInfo[] rgFiles = di.GetFiles("*.whois");
            if ( rgFiles.Length == 0 )
                Assert.Inconclusive("No test files for whois creation matching.");
            else {
                foreach ( System.IO.FileInfo fi in rgFiles ) {
                    string whois_data = System.IO.File.ReadAllText(fi.FullName).ToLower(); //Need lowercase
                    int age = target.GetAgeFromWhoisData(fi.Name, whois_data);
                    System.Diagnostics.Debug.WriteLine("Domain File: " + fi.Name + ", age: " + age);
                }
            }
            System.Diagnostics.Debug.WriteLine(" Age tests complete.");
        }
 public void ShouldBlockMessageTest()
 {
     YoungDomainSpamAgent_Accessor target = new YoungDomainSpamAgent_Accessor(); // TODO: Initialize to an appropriate value
     bool expected = true;
     bool actual;
     string body = "A spammy message.\nHere, have a link: http://hitfin.com/yay"; // TODO: Initialize to an appropriate value
     string subject = string.Empty; // TODO: Initialize to an appropriate value
     actual = target.ShouldBlockMessage(body, subject);
     Assert.AreEqual(actual, expected);
 }