Ejemplo n.º 1
0
        public virtual void Test()
        {
            ITestableReplicationProviderInside providerA = A().Provider();
            ITestableReplicationProviderInside providerB = B().Provider();

            providerA.StoreNew(new Pilot());
            providerA.Commit();
            IReplicationSession replication = Replication.Begin(providerA, providerB, null, _fixtures
                                                                .reflector);
            TimeStamps initialTimeStampsB = AssertTimeStampsForFirstReplication(providerB);
            IObjectSet modifiedObjects    = providerA.ObjectsChangedSinceLastReplication();

            while (modifiedObjects.HasNext())
            {
                replication.Replicate(modifiedObjects.Next());
            }
            replication.Commit();
            Pilot replicatedPilot = (Pilot)providerB.GetStoredObjects(typeof(Pilot)).Next();
            long  version         = providerB.ObjectVersion(replicatedPilot);

            Assert.AreEqual(initialTimeStampsB.Commit(), version);
            replication = Replication.Begin(providerA, providerB, null, _fixtures.reflector);
            TimeStamps timestampsBAfterReplication = AssertTimeStampsForSecondReplication(initialTimeStampsB
                                                                                          , providerB);

            replication.Commit();
            Pilot pilotStoredAfterReplication = new Pilot();

            providerB.StoreNew(pilotStoredAfterReplication);
            providerB.Commit();
            providerB.WaitForPreviousCommits();
            version = providerB.ObjectVersion(pilotStoredAfterReplication);
            Assert.IsGreater(timestampsBAfterReplication.Commit(), version);
        }
		private void StoreNewPilotIn(ITestableReplicationProviderInside provider)
		{
			Pilot pilot = new Pilot();
			provider.StoreNew(pilot);
			provider.Commit();
			provider.WaitForPreviousCommits();
		}
        private void StoreNewPilotIn(ITestableReplicationProviderInside provider)
        {
            Pilot pilot = new Pilot();

            provider.StoreNew(pilot);
            provider.Commit();
            provider.WaitForPreviousCommits();
        }
		private void ModifyPilotIn(ITestableReplicationProviderInside provider, string newName
			)
		{
			Pilot pilot;
			pilot = (Pilot)provider.GetStoredObjects(typeof(Pilot)).Next();
			pilot.SetName(newName);
			provider.Update(pilot);
			provider.Commit();
			provider.WaitForPreviousCommits();
		}
        private void ModifyPilotIn(ITestableReplicationProviderInside provider, string newName
                                   )
        {
            Pilot pilot;

            pilot = (Pilot)provider.GetStoredObjects(typeof(Pilot)).Next();
            pilot.SetName(newName);
            provider.Update(pilot);
            provider.Commit();
            provider.WaitForPreviousCommits();
        }