public void RestrictedCollectionWorksWithCertificate()
        {
            var Search2 = new PlainSearch(new Settings("authoring-hss.cp-access.com", "https://searchg2-restricted.crownpeak.net/", CertificateCreator.LoadCertificate("E63D2DCEB03E981968F373F5C419E043D9394AF9")));
            var results = Search2.Execute("*:*");

            Assert.AreEqual(results.TotalCount, 13, "Expected 13 results, found " + results.TotalCount);
        }
        public void RestrictedCollectionFailsWithoutCertificate()
        {
            var Search2 = new PlainSearch(new Settings("authoring-hss.cp-access.com", "https://searchg2-restricted.crownpeak.net/", null));
            var results = Search2.Execute("*:*");

            Assert.AreEqual(results.TotalCount, 0, "Expected 0 results, found " + results.TotalCount);
        }
 public void TimingOutReturnsTimeoutError()
 {
     //try
     //{
     //	ClearContainer();
     //	var container = Startup.Container;
     //	container.Register<IEndPointConfiguration>(c => new TimeoutTestEndPointConfiguration());
     //	ServiceLocator.SetLocatorProvider(() => container);
     //}
     //catch (Exception)
     //{
     //	// Ignore
     //}
     try
     {
         var s       = new PlainSearch(new Settings("www.crownpeak.com", _endpoint, 1));
         var results = s.Execute("crownpeak");
         Assert.IsTrue(results.Count == 10, "Expected 10 results, got " + results.Count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         // Restore the state
         SetupSearch();
     }
 }
 public void InvalidCollectionReturnsError()
 {
     //try
     //{
     //	ClearContainer();
     //	var container = Startup.Container;
     //	container.Register<IEndPointConfiguration>(c => new TestEndPointConfiguration());
     //	ServiceLocator.SetLocatorProvider(() => container);
     //}
     //catch (Exception)
     //{
     //	// Ignore
     //}
     try
     {
         var s       = new PlainSearch(new Settings("a-collection-that-does-not-exist"));
         var results = s.Execute("crownpeak");
         Assert.IsTrue(results.Count == 10, "Expected 10 results, got " + results.Count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         // Restore the state
         SetupSearch();
     }
 }
 public void SetupSearch()
 {
     //try
     //{
     //	var container = Startup.Container;
     //	container.Register<IEndPointConfiguration>(c => new TestEndPointConfiguration());
     //	ServiceLocator.SetLocatorProvider(() => container);
     //}
     //catch (Exception)
     //{
     //	// Ignore
     //}
     PlainSearch = new PlainSearch(new Settings("www.crownpeak.com"));
     Search = new Search<TestDocument>(new Settings("www.crownpeak.com"));
 }
示例#6
0
 public void SetupSearch()
 {
     //try
     //{
     //	var container = Startup.Container;
     //	container.Register<IEndPointConfiguration>(c => new TestEndPointConfiguration());
     //	ServiceLocator.SetLocatorProvider(() => container);
     //}
     //catch (Exception)
     //{
     //	// Ignore
     //}
     PlainSearch = new PlainSearch(new Settings("www.crownpeak.com"));
     Search      = new Search <TestDocument>(new Settings("www.crownpeak.com"));
 }
 public void SetupSearch()
 {
     //ClearContainer();
     //try
     //{
     //	var container = Startup.Container;
     //	container.RemoveAll<IEndPointConfiguration>();
     //	container.Register<IEndPointConfiguration>(c => new TestEndPointConfiguration());
     //	ServiceLocator.SetLocatorProvider(() => container);
     //}
     //catch (Exception)
     //{
     //	// Ignore
     //}
     PlainSearch = new PlainSearch(new Settings("www.crownpeak.com", _endpoint, _certificate));             // "www.crownpeak.com"));
 }