Ejemplo n.º 1
0
        /// <exception cref="Couchbase.Lite.CouchbaseLiteException"></exception>
        public virtual void TestPulledChangesAreExternal()
        {
            changeNotifications = 0;
            Database.ChangeListener changeListener = new _ChangeListener_61(this);
            database.AddChangeListener(changeListener);
            // Insert a document as if it came from a remote source.
            RevisionInternal             rev        = new RevisionInternal("docId", "1-rev", false, database);
            IDictionary <string, object> properties = new Dictionary <string, object>();

            properties.Put("_id", rev.GetDocId());
            properties.Put("_rev", rev.GetRevId());
            rev.SetProperties(properties);
            database.ForceInsert(rev, Arrays.AsList(rev.GetRevId()), GetReplicationURL());
            // Make sure that the assertion in changeListener was called.
            NUnit.Framework.Assert.AreEqual(1, changeNotifications);
        }
Ejemplo n.º 2
0
		/// <exception cref="Couchbase.Lite.CouchbaseLiteException"></exception>
		public virtual void TestPulledChangesAreExternal()
		{
			changeNotifications = 0;
			Database.ChangeListener changeListener = new _ChangeListener_61(this);
			database.AddChangeListener(changeListener);
			// Insert a document as if it came from a remote source.
			RevisionInternal rev = new RevisionInternal("docId", "1-rev", false, database);
			IDictionary<string, object> properties = new Dictionary<string, object>();
			properties.Put("_id", rev.GetDocId());
			properties.Put("_rev", rev.GetRevId());
			rev.SetProperties(properties);
			database.ForceInsert(rev, Arrays.AsList(rev.GetRevId()), GetReplicationURL());
			// Make sure that the assertion in changeListener was called.
			NUnit.Framework.Assert.AreEqual(1, changeNotifications);
		}