public void Export_ErrorOccurred_RaisesErrorEventArgs()
		{
			// arrange
			var repository = CreateRepository(maxNumberOfLogs: 1);
			var fileSystemHelper = new Mock<IFileSystemHelper>();
			var databaseCreator = new SqlCeDatabaseCreator(fileSystemHelper.Object, new FakeLog());
			var exporter = new ErrorLogExporter(repository, databaseCreator);

			repository.Initialize();

			var error = new InvalidOperationException();
			fileSystemHelper.Setup(x => x.FileExists(It.IsAny<string>())).Throws(error);

			// act
			var eventWasRaised = false;
			exporter.OnError += delegate(object sender, ErrorLogExporterErrorEventArgs args)
			                    	{
			                    		eventWasRaised = true;
										Assert.That(args.Error, Is.EqualTo(error));
			                    	};

			exporter.Export(_databaseFilename);

			// assert
			Assert.That(eventWasRaised, Is.True);
		}
		public void Export_Completed_RaisesCompletedEventArgs()
		{
			// arrange
			var repository = CreateRepository(maxNumberOfLogs: 1);
			var fileSystemHelper = new FileSystemHelper();
			var databaseCreator = new SqlCeDatabaseCreator(fileSystemHelper, new FakeLog());
			var exporter = new ErrorLogExporter(repository, databaseCreator);

			repository.Initialize();

			// act
			var eventWasRaised = false;
			exporter.OnCompleted += delegate { eventWasRaised = true; };

			exporter.Export(_databaseFilename);

			// assert
			Assert.That(eventWasRaised, Is.True);
		}
		public void Export_ProgessChanged_RaisesProgressChangedEventArgs()
		{
			// arrange
			var repository = CreateRepository(maxNumberOfLogs: 1);
			var fileSystemHelper = new FileSystemHelper();
			var databaseCreator = new SqlCeDatabaseCreator(fileSystemHelper, new FakeLog());
			var exporter = new ErrorLogExporter(repository, databaseCreator);

			repository.Initialize();

			// act
			var eventWasRaised = false;
			exporter.OnProgressChanged += delegate(object sender, ErrorLogExporterProgressEventArgs args)
			                              	{
			                              		eventWasRaised = true;
												Assert.That(args.Progress, Is.EqualTo("Exporting error log 1 of 1"));
			                              	};

			exporter.Export(_databaseFilename);

			// assert
			Assert.That(eventWasRaised, Is.True);
		}