BloomTestsThatAvoidTheSetupFixture.PdfMakerTests.MakePdf_BookNameIsChinese_OutputsPdf C# (CSharp) Method

MakePdf_BookNameIsChinese_OutputsPdf() private method

private MakePdf_BookNameIsChinese_OutputsPdf ( ) : void
return void
		public void MakePdf_BookNameIsChinese_OutputsPdf()
		{
			var maker = new PdfMaker();
			using (var input = TempFile.WithFilename("北京.html"))
			using (var output = TempFile.WithFilename("北京.pdf"))
			{
				RobustFile.WriteAllText(input.Path, "<html><body>北京</body></html>");
				RobustFile.Delete(output.Path);
				RunMakePdf(maker, input.Path, output.Path, "A5", false, false, false,
					PublishModel.BookletLayoutMethod.SideFold, PublishModel.BookletPortions.BookletPages);
				//we don't actually have a way of knowing it did a booklet
				Assert.IsTrue(File.Exists(output.Path), "Failed to convert trivial HTML file to PDF (Chinese filenames and content)");
				var bytes = File.ReadAllBytes(output.Path);
				Assert.Less(1000, bytes.Length, "Generated PDF file is way too small! (Chinese filenames and content)");
				Assert.IsTrue (bytes [0] == (byte)'%' && bytes [1] == (byte)'P' && bytes [2] == (byte)'D' && bytes [3] == (byte)'F',
					"Generated PDF file started with the wrong 4-byte signature (Chinese filenames and content)");
			}
		}