<commit_before>﻿using System;
using System.Diagnostics;
using System.IO;

namespace NDocRaptor {
    class Program {
        static void Main(string[] args) {
            var raptor = new DocRaptor("<your api key>", testMode: true);

            Action<DocRaptorResponse> test = response => {
                Console.WriteLine("Success: {0}", response.Success);
                Console.WriteLine("Error-phrase: {0}", response.ReasonPhrase);

                var tempFile = Path.GetTempFileName() + ".pdf";
                var bytes = response.Response.Content.ReadAsByteArrayAsync().Result;
                File.WriteAllBytes(tempFile, bytes);
                Process.Start(tempFile);
            };

            var html = "<html><head><title></title></head><body><h1>Yeah</h1></body></html>";
            test(raptor.CreatePdfDocumentAsync(html).Result);
            test(raptor.CreatePdfDocumentAsync(new Uri("https://html.spec.whatwg.org/multipage/")).Result);

            Console.ReadLine();
        }
    }
}<commit_msg>Improve test.<commit_after>﻿using System;
using System.Diagnostics;
using System.IO;

namespace NDocRaptor {
    class Program {
        static void Main(string[] args) {
            var raptor = new DocRaptor("<your api key>", testMode: true);

            Action<DocRaptorResponse> test = response => {
                Console.WriteLine("Success: {0}", response.Success);
                Console.WriteLine("Error-phrase: {0}", response.ReasonPhrase);

                if (response.Success) {
                    var tempFile = Path.GetTempFileName() + ".pdf";
                    var bytes = response.Response.Content.ReadAsByteArrayAsync().Result;
                    File.WriteAllBytes(tempFile, bytes);
                    Process.Start(tempFile);
                }
            };

            var html = "<html><head><title></title></head><body><h1>Yeah</h1></body></html>";
            test(raptor.CreatePdfDocumentAsync(html).Result);
            test(raptor.CreatePdfDocumentAsync(new Uri("https://html.spec.whatwg.org/multipage/")).Result);

            Console.ReadLine();
        }
    }
}
{'fraction_non_alphanumeric': 0.13909774436090225, 'fraction_numerical': 0.0037593984962406013, 'mean_word_length': 2.216012084592145, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 29, 'https://': 2, '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': '3277111', 'n_tokens_mistral': 596, 'n_tokens_neox': 571, 'n_words': 99}