internal Utils.Results Process(string userAgentPattern, string devicePattern, Validation state)
        {
            var results     = new FiftyOne.Tests.Integration.Utils.Results();
            var random      = new Random(0);
            var httpHeaders = _provider.HttpHeaders.Where(i => i.Equals("User-Agent") == false).ToArray();

            // Loop through setting 2 User-Agent headers.
            var userAgentIterator = UserAgentGenerator.GetEnumerable(20000, userAgentPattern).GetEnumerator();
            var deviceIterator    = UserAgentGenerator.GetEnumerable(20000, devicePattern).GetEnumerator();

            while (userAgentIterator.MoveNext() &&
                   deviceIterator.MoveNext())
            {
                var headers = new NameValueCollection();
                headers.Add(httpHeaders[random.Next(httpHeaders.Length)], deviceIterator.Current);
                headers.Add("User-Agent", userAgentIterator.Current);
                var indexes = _provider.GetDeviceIndexes(headers);
                Assert.IsTrue(indexes.Count > 0, "No indexes were found");
                Validate(indexes, state);
            }

            return(results);
        }
Пример #2
0
 public void API_Trie_NullHeaders()
 {
     FetchAllProperties(_provider.GetDeviceIndexes((NameValueCollection)null));
 }