Exemplo n.º 1
0
 public Depth2Stimulus(PrefetchConfigurationTestCase _enclosing, MsgD[] expectedMessagesAfter
                       ) : base(expectedMessagesAfter)
 {
     this._enclosing = _enclosing;
 }
			public RootItem(PrefetchConfigurationTestCase.Item child) : base(child)
			{
			}
 public Depth2Stimulus(PrefetchConfigurationTestCase _enclosing, MsgD[] expectedMessagesAfter
     ) : base(expectedMessagesAfter)
 {
     this._enclosing = _enclosing;
 }
		private void Purge(Sharpen.Util.ISet purged, PrefetchConfigurationTestCase.Item item
			)
		{
			if (purged.Contains(item))
			{
				return;
			}
			purged.Add(item);
			Client().Purge(item);
			PrefetchConfigurationTestCase.Item child = item.child;
			if (null != child)
			{
				Purge(purged, child);
			}
		}
			public Item(PrefetchConfigurationTestCase.Item child)
			{
				this.child = child;
			}
		private void PurgeAll(PrefetchConfigurationTestCase.Item[] items)
		{
			HashSet purged = new HashSet();
			for (int itemIndex = 0; itemIndex < items.Length; ++itemIndex)
			{
				PrefetchConfigurationTestCase.Item item = items[itemIndex];
				Purge(purged, item);
			}
		}
		private void StoreAll(PrefetchConfigurationTestCase.Item[] items)
		{
			for (int itemIndex = 0; itemIndex < items.Length; ++itemIndex)
			{
				PrefetchConfigurationTestCase.Item item = items[itemIndex];
				Client().Store(item);
			}
		}
		private void StoreAllAndPurge(PrefetchConfigurationTestCase.Item[] items)
		{
			StoreAll(items);
			PurgeAll(items);
			Client().Commit();
		}
			protected virtual void ActUpon(PrefetchConfigurationTestCase.Item item)
			{
				Assert.IsNotNull(item.child);
				this._enclosing.Db().Activate(item.child, 1);
			}
Exemplo n.º 10
0
		private void AssertQueryIterationProtocol(IQuery query, MsgD expectedResultMessage
			, PrefetchConfigurationTestCase.Stimulus[] stimuli)
		{
			IList messages = MessageCollector.ForServerDispatcher(ServerDispatcher());
			IObjectSet result = query.Execute();
			AssertMessages(messages, new IMessage[] { expectedResultMessage });
			messages.Clear();
			for (int stimulusIndex = 0; stimulusIndex < stimuli.Length; ++stimulusIndex)
			{
				PrefetchConfigurationTestCase.Stimulus stimulus = stimuli[stimulusIndex];
				stimulus.ActUpon(result);
				AssertMessages(messages, stimulus.expectedMessagesAfter);
				messages.Clear();
			}
			if (result.HasNext())
			{
				Assert.Fail("Unexpected item: " + ((PrefetchConfigurationTestCase.Item)result.Next
					()));
			}
			AssertMessages(messages, new IMessage[] {  });
		}