<commit_before>using Xunit;
using System;
using System.Management.Automation;
using System.Management.Automation.Runspaces;

namespace PSTests
{
    // NOTE: do not call AddCommand("out-host") after invoking or MergeMyResults,
    // otherwise Invoke will not return any objects

    public class RunspaceTests: IDisposable
    {
        private static int count = 3;
        private static string script = String.Format($"get-process | select-object -first {count}");

        public RunspaceTests()
        {
            TypeCatalog.GenerateTypeCatalog();
            Assert.NotNull(System.Management.Automation.ClrHost.TypeCatalog);
        }

        public void Dispose()
        {
        }

        [Fact]
        public void TestRunspaceWithPipeline()
        {
            Assert.NotNull(System.Management.Automation.ClrHost.TypeCatalog);
            using (Runspace runspace = RunspaceFactory.CreateRunspace())
            {
                runspace.Open();

                using (var pipeline = runspace.CreatePipeline(script))<commit_msg>Remove GenerateTypeCatalog from RunspaceTests<commit_after>using Xunit;
using System;
using System.Management.Automation;
using System.Management.Automation.Runspaces;

namespace PSTests
{
    // NOTE: do not call AddCommand("out-host") after invoking or MergeMyResults,
    // otherwise Invoke will not return any objects

    public class RunspaceTests
    {
        private static int count = 3;
        private static string script = String.Format($"get-process | select-object -first {count}");

        [Fact]
        public void TestRunspaceWithPipeline()
        {
            using (Runspace runspace = RunspaceFactory.CreateRunspace())
            {
                runspace.Open();

                using (var pipeline = runspace.CreatePipeline(script))
{'fraction_non_alphanumeric': 0.08539944903581267, 'fraction_numerical': 0.0011019283746556473, 'mean_word_length': 2.56078431372549, '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': '1084586', 'n_tokens_mistral': 472, 'n_tokens_neox': 455, 'n_words': 121}