<commit_before>// Copyright 2007-2008 The Apache Software Foundation.
//  
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use 
// this file except in compliance with the License. You may obtain a copy of the 
// License at 
// 
//     http://www.apache.org/licenses/LICENSE-2.0 
// 
// Unless required by applicable law or agreed to in writing, software distributed 
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
// CONDITIONS OF ANY KIND, either express or implied. See the License for the 
// specific language governing permissions and limitations under the License.
namespace Topshelf.Specs
{
    using NUnit.Framework;
    using Topshelf.Configuration;

    [TestFixture]
    public class ArgParsing_Specs
    {
        string _args;

        [SetUp]
        public void Establish_Context()
        {
            _args = "install /instance:bob";
        }

        [Test]
        public void InstanceName()
        {
            TopshelfArguments a = TopshelfArgumentParser.Parse(_args);
            a.Instance.ShouldEqual("bob");
            a.ActionName.ShouldEqual(ServiceActionNames.Install);
        }
    }
}<commit_msg>Magicing some specs in place instead of using the using the one existing test.<commit_after>// Copyright 2007-2008 The Apache Software Foundation.
//  
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use 
// this file except in compliance with the License. You may obtain a copy of the 
// License at 
// 
//     http://www.apache.org/licenses/LICENSE-2.0 
// 
// Unless required by applicable law or agreed to in writing, software distributed 
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
// CONDITIONS OF ANY KIND, either express or implied. See the License for the 
// specific language governing permissions and limitations under the License.
namespace Topshelf.Specs
{
    using Magnum.TestFramework;
    using NUnit.Framework;
    using Topshelf.Configuration;

    [Scenario]
    public class Given_a_command_line
    {
        protected string CommandLine
        {
            set
            {
                Arguments = TopshelfArgumentParser.Parse(value);
            }
        }
        protected TopshelfArguments Arguments { get; set; }
    }

    [Scenario]
    public class Given_no_command_line :
        Given_a_command_line
    {
        [Given]
        public void An_empty_command_line()
        {
            CommandLine = string.Empty;
        }

        [Then]
        public void Action_should_be_run()
        {
            Arguments.ActionName.ShouldEqual(ServiceActionNames.Run);
        }
        
        [Then]
        public void Instance_should_be_empty()
        {
            Arguments.Instance.ShouldBeEmpty();
        }
    }

    [Scenario, Explicit("Not Yet Implemented")]
    public class Given_service_install_command_line :
        Given_a_command_line
    {
        [Given]
        public void Service_install_command_line()
        {
            CommandLine = "service install";
        }

        [Then]
        public void Action_should_be_install()
        {
            Arguments.ActionName.ShouldEqual(ServiceActionNames.Install);
        }

        [Then]
        public void Instance_should_be_empty()
        {
            Arguments.Instance.ShouldBeEmpty();
        }
    }

    [Scenario]
    public class Give_install_with_an_instance :
        Given_a_command_line
    {
        [Given]
        public void An_empty_command_line()
        {
            CommandLine = "install /instance:bob";
        }

        [Then]
        public void Action_should_be_install()
        {
            Arguments.ActionName.ShouldEqual(ServiceActionNames.Install);
        }

        [Then]
        public void Instance_should_be_bob()
        {
            Arguments.Instance.ShouldEqual("bob");
        }
    }
}
{'fraction_non_alphanumeric': 0.0773156417453432, 'fraction_numerical': 0.0061240112273539165, 'mean_word_length': 2.1160572337042924, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2123949', 'n_tokens_mistral': 1076, 'n_tokens_neox': 1025, 'n_words': 302}