<commit_before>using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using InstallerLib;
using dotNetUnitTestsRunner;
using System.IO;

namespace dotNetInstallerUnitTests
{
    [TestFixture]
    public class SelectionUnitTests
    {
        [Test]
        public void TestDefaultSelection()
        {
            ConfigFile configFile = new ConfigFile();
            // setup configuration
            SetupConfiguration setupConfiguration = new SetupConfiguration();
            configFile.Children.Add(setupConfiguration);
            // dummy component 1
            ComponentCmd component1 = new ComponentCmd();
            setupConfiguration.Children.Add(component1);
            component1.command = "cmd.exe /C exit /b 57";
            component1.selected = false;
            // dummy component 2
            ComponentCmd component2 = new ComponentCmd();
            setupConfiguration.Children.Add(component2);
            component2.command = "cmd.exe /C exit /b 42";
            component2.selected = true;
            // second component is selected and runs, not the first one
            string configFilename = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString() + ".xml");
            Console.WriteLine("Writing '{0}'", configFilename);
            configFile.SaveAs(configFilename);
            dotNetInstallerExeUtils.RunOptions options = new dotNetInstallerExeUtils.RunOptions(configFilename);
            Assert.AreEqual(42, dotNetInstallerExeUtils.Run(options));
            File.Delete(configFilename);
        }
    }
}<commit_msg>Added test with default selection = true.<commit_after>using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using InstallerLib;
using dotNetUnitTestsRunner;
using System.IO;

namespace dotNetInstallerUnitTests
{
    [TestFixture]
    public class SelectionUnitTests
    {
        [Test]
        public void TestDefaultSelection()
        {
            ConfigFile configFile = new ConfigFile();
            // setup configuration
            SetupConfiguration setupConfiguration = new SetupConfiguration();
            configFile.Children.Add(setupConfiguration);
            // dummy component 1
            ComponentCmd component1 = new ComponentCmd();
            setupConfiguration.Children.Add(component1);
            component1.command = "cmd.exe /C exit /b 57";
            component1.selected = false;
            // dummy component 2
            ComponentCmd component2 = new ComponentCmd();
            setupConfiguration.Children.Add(component2);
            component2.command = "cmd.exe /C exit /b 42";
            component2.selected = true;
            // second component is selected and runs, not the first one
            string configFilename = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString() + ".xml");
            Console.WriteLine("Writing '{0}'", configFilename);
            configFile.SaveAs(configFilename);
            dotNetInstallerExeUtils.RunOptions options = new dotNetInstallerExeUtils.RunOptions(configFilename);
            Assert.AreEqual(42, dotNetInstallerExeUtils.Run(options));
            // first component is selected and runs
            component1.selected = true;
            Console.WriteLine("Writing '{0}'", configFilename);
            configFile.SaveAs(configFilename);
            Assert.AreEqual(57, dotNetInstallerExeUtils.Run(options));
            File.Delete(configFilename);
        }
    }
}
{'fraction_non_alphanumeric': 0.08924485125858124, 'fraction_numerical': 0.010869565217391304, 'mean_word_length': 2.4935064935064934, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6436434', 'n_tokens_mistral': 857, 'n_tokens_neox': 831, 'n_words': 205}