<commit_before>﻿#if !__MonoCS__
using System.Drawing;
using System.IO;
using System.Linq;
using System.Threading;
using System.Windows.Forms;
using Bloom;
using Bloom.Book;
using Bloom.web;
using BloomTests.Book;
using BloomTests.web;
using NUnit.Framework;
using SIL.IO;

namespace BloomTests.Publish
{
	[TestFixture]
	public class UsbPublisherTests : BookTestsBase
	{
		private static BookSelection s_bookSelection;
		private BookServer _bookServer;

		[OneTimeSetUp]
		public void OneTimeSetup()
		{
			SetupTestBookSelection();
		}

		public override void Setup()
		{
			base.Setup();
			Program.SetUpLocalization(new ApplicationContainer());
			_bookServer = CreateBookServer();
			s_bookSelection.SelectBook(CreateBook());
		}

		private static void SetupTestBookSelection()
		{
			s_bookSelection = new BookSelection();
		}

		private static WebSocketProgress CreateWebSocketProgress(out WebSocketServerSpy spy)
		{
			spy = new WebSocketServerSpy();
			spy.Init("webSocketServerSpy");
			return new WebSocketProgress( spy, "ummm...");
		}

		[Test]
		public void SendBookAsync_HandlesDiskFullException()
		{<commit_msg>Change test setup to prevent unit tests from opening dialogs<commit_after>﻿#if !__MonoCS__
using System.Drawing;
using System.IO;
using System.Linq;
using System.Threading;
using System.Windows.Forms;
using Bloom.Book;
using Bloom.web;
using BloomTests.Book;
using BloomTests.web;
using L10NSharp;
using NUnit.Framework;
using SIL.IO;

namespace BloomTests.Publish
{
	[TestFixture]
	public class UsbPublisherTests : BookTestsBase
	{
		private static BookSelection s_bookSelection;
		private BookServer _bookServer;
		private LocalizationManager _localizationManager;

		[OneTimeSetUp]
		public void OneTimeSetup()
		{
			LocalizationManager.UseLanguageCodeFolders = true;
			var localizationDirectory = FileLocationUtilities.GetDirectoryDistributedWithApplication("localization");
			_localizationManager = LocalizationManager.Create("fr", "Bloom", "Bloom", "1.0.0", localizationDirectory, "SIL/Bloom",
				null, "");
			SetupTestBookSelection();
		}

		[OneTimeTearDown]
		public void OneTimeTearDown()
		{
			_localizationManager.Dispose();
			LocalizationManager.ForgetDisposedManagers();
		}

		public override void Setup()
		{
			base.Setup();
			_bookServer = CreateBookServer();
			s_bookSelection.SelectBook(CreateBook());
		}

		private static void SetupTestBookSelection()
		{
			s_bookSelection = new BookSelection();
		}

		private static WebSocketProgress CreateWebSocketProgress(out WebSocketServerSpy spy)
		{
			spy = new WebSocketServerSpy();
			spy.Init("webSocketServerSpy");
			return new WebSocketProgress( spy, "ummm...");
		}

		[Test]
		public void SendBookAsync_HandlesDiskFullException()
		{
{'fraction_non_alphanumeric': 0.09475218658892129, 'fraction_numerical': 0.0018221574344023323, 'mean_word_length': 5.1824324324324325, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2640011', 'n_tokens_mistral': 935, 'n_tokens_neox': 832, 'n_words': 191}