/// <exception cref="System.Exception"></exception>
        public virtual void TestRunReplicationWithError()
        {
            HttpClientFactory mockHttpClientFactory = new _HttpClientFactory_516();
            string            dbUrlString           = "http://fake.test-url.com:4984/fake/";
            Uri         remote     = new Uri(dbUrlString);
            bool        continuous = false;
            Replication r1         = new Puller(database, remote, continuous, mockHttpClientFactory,
                                                manager.GetWorkExecutor());

            NUnit.Framework.Assert.IsFalse(r1.IsContinuous());
            RunReplication(r1);
            // It should have failed with a 404:
            NUnit.Framework.Assert.AreEqual(Replication.ReplicationStatus.ReplicationStopped,
                                            r1.GetStatus());
            NUnit.Framework.Assert.AreEqual(0, r1.GetCompletedChangesCount());
            NUnit.Framework.Assert.AreEqual(0, r1.GetChangesCount());
            NUnit.Framework.Assert.IsNotNull(r1.GetLastError());
        }
Ejemplo n.º 2
0
		/// <exception cref="System.Exception"></exception>
		public virtual void TestRunReplicationWithError()
		{
			HttpClientFactory mockHttpClientFactory = new _HttpClientFactory_516();
			string dbUrlString = "http://fake.test-url.com:4984/fake/";
			Uri remote = new Uri(dbUrlString);
			bool continuous = false;
			Replication r1 = new Puller(database, remote, continuous, mockHttpClientFactory, 
				manager.GetWorkExecutor());
			NUnit.Framework.Assert.IsFalse(r1.IsContinuous());
			RunReplication(r1);
			// It should have failed with a 404:
			NUnit.Framework.Assert.AreEqual(Replication.ReplicationStatus.ReplicationStopped, 
				r1.GetStatus());
			NUnit.Framework.Assert.AreEqual(0, r1.GetCompletedChangesCount());
			NUnit.Framework.Assert.AreEqual(0, r1.GetChangesCount());
			NUnit.Framework.Assert.IsNotNull(r1.GetLastError());
		}