Пример #1
0
		public void ComparisonTrackerTest04()
		{
			_reset = new ManualResetEvent(false);
			var item = new MockMailItem
			           	{
			           		EntryID = "test1"
			           	};
			var prop = item.UserProperties.Add(NamedProperties.CompareRequired, OlUserPropertyType.olText, true, null);
			prop.Value = "Testing";

			_selector.Items.Add(item);

			ComparisonInformation ci = CreateComparison("test 1", "test 2");
			ci.Completed += OnSingleCompleted;
			using (var tracker = new MockComparisonTracker(_selector))
			{
				tracker.SaveChangeSummary = true;
				tracker.RedlineStorageLocation = Path.GetTempPath();
				tracker.StartMonitoring();
				Thread.Sleep(500);
				tracker.AddToQueue(ci);
				Assert.IsTrue(_reset.WaitOne(new TimeSpan(0, 0, 1)));
			}
		}
Пример #2
0
		public void ComparisonTrackerTest05()
		{
			_reset = new ManualResetEvent(false);
			_workDone = 0;
			using (var tracker = new MockComparisonTracker(_selector))
			{
				tracker.SaveChangeSummary = true;
				tracker.RedlineStorageLocation = Path.GetTempPath();
				tracker.StartMonitoring();

				for (int i = 0; i < 10; i++)
				{

					var name = string.Format("Test - {0}", i);
					var item = new MockMailItem
					{
						EntryID = name
					};
					var prop = item.UserProperties.Add(NamedProperties.CompareRequired, OlUserPropertyType.olText, true, null);
					prop.Value = "Testing";
					var ci = CreateComparison(name, name);
					ci.Completed += OnCompleted;
					tracker.AddToQueue(ci);
				}
				Assert.IsTrue(_reset.WaitOne(new TimeSpan(0, 0, 5)));
			}
		}