예제 #1
0
        public async Task GetDomainReportUnknownDomain()
        {
            //Reports don't contain all these fields when it is unknown
            IgnoreMissingJson(" / undetected_urls", " / Alexa category", " / Alexa domain info", " / Alexa rank", " / BitDefender category", " / BitDefender domain info", " / Categories", " / detected_communicating_samples", " / detected_downloaded_samples", " / detected_referrer_samples", " / detected_urls", " / domain_siblings", " / Dr.Web category", " / Forcepoint ThreatSeeker category", " / Opera domain info", " / Pcaps", " / Resolutions", " / subdomains", " / TrendMicro category", " / undetected_communicating_samples", " / undetected_downloaded_samples", " / undetected_referrer_samples", " / Websense ThreatSeeker category", " / Webutation domain info", " / whois", " / whois_timestamp", " / WOT domain info");

            DomainReport report = await VirusTotal.GetDomainReportAsync(TestData.GetUnknownDomains(1).First());

            Assert.Equal(DomainResponseCode.NotPresent, report.ResponseCode);
        }
예제 #2
0
        private async Task <DomainReport> GetDomainReportAsyncWithRetries(string itemName, int sleepTime = 0, int timeAddition = 0)
        {
            DomainReport domainReport = null;

            try
            {
                domainReport = await virusTotal.GetDomainReportAsync(itemName);
            }
            catch
            {
                Thread.Sleep(sleepTime);
                domainReport = await GetDomainReportAsyncWithRetries(itemName, sleepTime + timeAddition);
            }
            return(domainReport);
        }
예제 #3
0
        public async Task GetDomainReportKnownDomain()
        {
            DomainReport report = await VirusTotal.GetDomainReportAsync(TestData.KnownDomains.First());

            Assert.Equal(DomainResponseCode.Present, report.ResponseCode);
        }