Skip to content

Implemented dotnet core supporting #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ _ReSharper.*
bin
obj
packages/*
.idea/*
!repositories.config
packages/
_ncrunch*
*.ncrunch*
project.lock.json
40 changes: 20 additions & 20 deletions FluentCommandLineParser.Tests/CommandLineOptionFormatterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,18 @@
using System.Text;
using Fclp.Internals;
using Moq;
using NUnit.Framework;
using Xunit;

namespace FluentCommandLineParser.Tests
{
/// <summary>
/// Contains unit test for the <see cref="CommandLineOptionFormatter"/> test.
/// </summary>
[TestFixture]
public class CommandLineOptionFormatterTests
{
#region Constructors

[Test]
[Fact]
public void Ensure_Can_Be_Constructed()
{
new CommandLineOptionFormatter();
Expand All @@ -49,7 +48,7 @@ public void Ensure_Can_Be_Constructed()

#region Properties

[Test]
[Fact]
public void Ensure_ValueText_Can_Be_Set()
{
var formatter = new CommandLineOptionFormatter();
Expand All @@ -58,10 +57,10 @@ public void Ensure_ValueText_Can_Be_Set()

formatter.ValueText = expected;

Assert.AreEqual(expected, formatter.ValueText);
Assert.Equal(expected, formatter.ValueText);
}

[Test]
[Fact]
public void Ensure_DescriptionText_Can_Be_Set()
{
var formatter = new CommandLineOptionFormatter();
Expand All @@ -70,10 +69,10 @@ public void Ensure_DescriptionText_Can_Be_Set()

formatter.DescriptionText = expected;

Assert.AreEqual(expected, formatter.DescriptionText);
Assert.Equal(expected, formatter.DescriptionText);
}

[Test]
[Fact]
public void Ensure_NoOptionsText_Can_Be_Set()
{
var formatter = new CommandLineOptionFormatter();
Expand All @@ -82,10 +81,10 @@ public void Ensure_NoOptionsText_Can_Be_Set()

formatter.NoOptionsText = expected;

Assert.AreEqual(expected, formatter.NoOptionsText);
Assert.Equal(expected, formatter.NoOptionsText);
}

[Test]
[Fact]
public void Ensure_Header_Can_Be_Set()
{
var formatter = new CommandLineOptionFormatter();
Expand All @@ -94,23 +93,22 @@ public void Ensure_Header_Can_Be_Set()

formatter.Header = expected;

Assert.AreEqual(expected, formatter.Header);
Assert.Equal(expected, formatter.Header);
}

#endregion Properties

#region Format

[Test]
[ExpectedException(typeof(ArgumentNullException))]
[Fact]
public void Ensure_Cannot_Specify_Null_options_Param()
{
var formatter = new CommandLineOptionFormatter();

formatter.Format(null);
Assert.Throws<ArgumentNullException>(() => formatter.Format(null));
}

[Test]
[Fact]
public void Ensure_Format_Returns_Expected_String()
{
var formatter = new CommandLineOptionFormatter();
Expand All @@ -132,10 +130,11 @@ public void Ensure_Format_Returns_Expected_String()
var expected = expectedSb.ToString();
var actual = formatter.Format(new[] { mockOptionB, mockOptionA, mockOptionC });

Assert.AreEqual(expected, actual, "Formatter returned unexpected string");
//Assert.Equal(expected, actual, "Formatter returned unexpected string");
Assert.Equal(expected, actual);
}

[Test]
[Fact]
public void Ensure_Header_Is_Displayed_If_One_Is_Set()
{
var formatter = new CommandLineOptionFormatter();
Expand Down Expand Up @@ -163,17 +162,18 @@ public void Ensure_Header_Is_Displayed_If_One_Is_Set()
var expected = expectedSb.ToString();
var actual = formatter.Format(new[] { mockOption1, mockOption2 });

Assert.AreEqual(expected, actual, "Formatter returned unexpected string");
//Assert.Equal(expected, actual, "Formatter returned unexpected string");
Assert.Equal(expected, actual);
}

[Test]
[Fact]
public void Ensure_NoOptionsText_Returned_If_No_options_Have_Been_Setup()
{
var formatter = new CommandLineOptionFormatter();

var actual = formatter.Format(new ICommandLineOption[0]);

Assert.AreEqual(formatter.NoOptionsText, actual);
Assert.Equal(formatter.NoOptionsText, actual);
}

#endregion Format
Expand Down

This file was deleted.

225 changes: 27 additions & 198 deletions FluentCommandLineParser.Tests/FluentCommandLineParser.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,198 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A2546703-0B86-4515-BE5B-FAF85B756BDC}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Fclp.Tests</RootNamespace>
<AssemblyName>FluentCommandLineParser.Tests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Machine.Specifications, Version=0.9.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Machine.Specifications.0.9.1\lib\net40\Machine.Specifications.dll</HintPath>
</Reference>
<Reference Include="Machine.Specifications.Clr4, Version=0.9.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Machine.Specifications.0.9.1\lib\net40\Machine.Specifications.Clr4.dll</HintPath>
</Reference>
<Reference Include="Machine.Specifications.Should">
<HintPath>..\packages\Machine.Specifications.Should.0.7.2\lib\net40\Machine.Specifications.Should.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Moq, Version=4.0.10827.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=2.6.2.12296, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NUnit.2.6.2\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Ploeh.AutoFixture, Version=3.0.8.0, Culture=neutral, PublicKeyToken=b24654c590009d4f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\AutoFixture.3.0.8\lib\net40\Ploeh.AutoFixture.dll</HintPath>
</Reference>
<Reference Include="Ploeh.AutoFixture.AutoMoq, Version=3.0.8.0, Culture=neutral, PublicKeyToken=b24654c590009d4f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\AutoFixture.AutoMoq.3.0.8\lib\net40\Ploeh.AutoFixture.AutoMoq.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="xunit, Version=1.9.1.1600, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\xunit.1.9.1\lib\net20\xunit.dll</HintPath>
</Reference>
<Reference Include="xunit.extensions, Version=1.9.1.1600, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\xunit.extensions.1.9.1\lib\net20\xunit.extensions.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Integration\Int64InlineDataAttribute.cs" />
<Compile Include="Integration\Lists\Int64ListInlineDataAttribute.cs" />
<Compile Include="UriTests.cs" />
<Compile Include="CommandLineOptionFormatterTests.cs" />
<Compile Include="FluentCommandLineParserBuilderTests.cs" />
<Compile Include="FluentCommandLineParserMSpecTests.cs" />
<Compile Include="FluentCommandLineParserTests.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="FluentCommandLineParser\Behaviour\InvalidOptionSetupBehaviour.cs" />
<Compile Include="FluentCommandLineParser\TestContext\TestEnum.cs" />
<Compile Include="FluentCommandLineParser\TestContext\TestEnumFlag.cs" />
<Compile Include="FluentCommandLineParser\TestContext\TestException.cs" />
<Compile Include="FluentCommandLineParser\TestContext\FluentCommandLineParserTestContext.cs" />
<Compile Include="FluentCommandLineParser\TestContext\SettingUpALongOptionTestContext.cs" />
<Compile Include="FluentCommandLineParser\TestContext\SettingUpAShortOptionTestContext.cs" />
<Compile Include="FluentCommandLineParser\when_executing_parse_operation\with_options_that_are_not_specified_in_the_args.cs" />
<Compile Include="FluentCommandLineParser\when_executing_parse_operation\with_options_that_are_specified_in_the_args.cs" />
<Compile Include="Integration\BoolInlineDataAttribute.cs" />
<Compile Include="Integration\DoubleInlineDataAttribute.cs" />
<Compile Include="Integration\EnumInlineDataAttribute.cs" />
<Compile Include="Integration\Int32EnumInlineDataAttribute.cs" />
<Compile Include="Integration\Int32InlineDataAttribute.cs" />
<Compile Include="Integration\IntegrationTests.cs" />
<Compile Include="Integration\Lists\ArgumentInlineDataAttribute.cs" />
<Compile Include="Integration\Lists\BoolListInlineDataAttribute.cs" />
<Compile Include="Integration\Lists\DoubleListInlineDataAttribute.cs" />
<Compile Include="Integration\Lists\EnumFlagListInlineDataAttribute .cs" />
<Compile Include="Integration\Lists\EnumListInlineDataAttribute.cs" />
<Compile Include="Integration\Lists\Int32ListInlineDataAttribute.cs" />
<Compile Include="Integration\Lists\FlagTests.cs" />
<Compile Include="Integration\Lists\ListTests.cs" />
<Compile Include="Integration\Lists\StringListInlineDataAttribute.cs" />
<Compile Include="Integration\NCrunchExcelDataAttribute.cs" />
<Compile Include="Integration\SimpleShortOptionsAreParsedCorrectlyAttribute.cs" />
<Compile Include="Integration\StringInlineDataAttribute.cs" />
<Compile Include="Internals\AnonymousMock.cs" />
<Compile Include="Internals\CommandLineOptionGrouperTests.cs" />
<Compile Include="Internals\CommandLineParserEngineMark2Tests.cs" />
<Compile Include="Internals\CommandLineParserEngineMark2TestsXUnit.cs" />
<Compile Include="Internals\CommandLineParserEngine\TestContext\CommandLineParserEngineTestContext.cs" />
<Compile Include="Internals\CommandLineParserEngine\when_args_contains_a_boolean_option_that_ends_with_no_sign.cs" />
<Compile Include="Internals\HelpCommandLineOptionTests.cs" />
<Compile Include="Internals\TestContextBase.cs" />
<Compile Include="Internals\Validators\OptionNameValidatorTests.cs" />
<Compile Include="Internals\Validators\NoDuplicateOptionValidatorTests.cs" />
<Compile Include="TestApplicationArgs.cs" />
<Compile Include="TestContext\TestContext.cs" />
<Compile Include="FluentCommandLineParser\TestContext\TestType.cs" />
<Compile Include="FluentCommandLineParser\when_executing_parse_operation\with_options_that_have_not_been_setup.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\and_the_option_factory\throws_an_error.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\with_a_long_name\with_a_long_name_that_is_already_used_but_differs_by_case.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\with_a_short_name\with_a_short_name_that_is_already_used_but_differs_by_case.cs" />
<Compile Include="FluentCommandLineParser\when_using_an_option_factory\that_is_custom.cs" />
<Compile Include="FluentCommandLineParser\when_executing_parse_operation\with_a_parser_engine_that_is_custom.cs" />
<Compile Include="FluentCommandLineParser\when_a_new_instance_is_created.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\with_a_long_name\with_a_long_name.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\with_a_short_name\with_a_short_name.cs" />
<Compile Include="FluentCommandLineParser\when_using_an_option_factory\that_has_been_set_to_null.cs" />
<Compile Include="FluentCommandLineParser\when_executing_parse_operation\with_a_parser_engine_that_is_null.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\and_the_option_factory\returns_a_null_option.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\with_a_long_name\with_a_long_name_that_contains_an_equality_sign.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\with_a_long_name\with_a_long_name_that_contains_a_colon.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\with_a_long_name\with_a_long_name_that_contains_whitespace.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\with_a_long_name\with_a_long_name_that_is_already_used.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\with_a_long_name\with_a_long_name_that_is_empty.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\with_a_long_name\with_a_long_name_that_is_valid.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\with_a_long_name\with_a_long_name_that_is_whitespace.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\with_a_short_name\with_a_short_name_that_contains_an_equality_sign.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\with_a_short_name\with_a_short_name_that_contains_a_colon.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\with_a_short_name\with_a_short_name_that_contains_whitespace.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\with_a_short_name\with_a_short_name_that_is_already_used.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\with_a_short_name\with_a_short_name_that_is_a_control_char.cs" />
<Compile Include="FluentCommandLineParser\when_setting_up_a_new_option\with_a_short_name\with_a_short_name_that_is_whitespace.cs" />
<Compile Include="HelperExtensions.cs" />
<Compile Include="Internals\CommandLineOptionFactoryTests.cs" />
<Compile Include="Internals\CommandLineOptionParserFactoryTests.cs" />
<Compile Include="Internals\CommandLineOptionTests.cs" />
<Compile Include="Internals\CommandLineParserEngine\Behaviour\NoResultsBehaviour.cs" />
<Compile Include="Internals\CommandLineParserEngine\when_arg_contains_key_and_value_assignment_but_no_value.cs" />
<Compile Include="Internals\CommandLineParserEngine\when_a_new_instance_is_created.cs" />
<Compile Include="Internals\CommandLineParserEngine\when_specified_args_are_empty.cs" />
<Compile Include="Internals\CommandLineParserEngine\when_specified_args_are_null.cs" />
<Compile Include="Internals\CommandLineParserEngine\when_specified_args_contain_no_keys.cs" />
<Compile Include="Mspec\Subjects.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FluentCommandLineParser\FluentCommandLineParser.csproj">
<Project>{74CDFA61-81D8-40F2-B536-949BABA15D3E}</Project>
<Name>FluentCommandLineParser</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Internals\Parsing\OptionParsers\" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AutoFixture" Version="4.5.0" />
<PackageReference Include="AutoFixture.AutoMoq" Version="4.5.0" />
<PackageReference Include="Machine.Fakes.Moq" Version="2.9.0" />
<PackageReference Include="Machine.Specifications" Version="0.12.0" />
<PackageReference Include="Machine.Specifications.Runner.VisualStudio" Version="2.7.0" />
<PackageReference Include="Machine.Specifications.Should" Version="0.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Moq" Version="4.10.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="Xunit.Extension" Version="1.0.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
<PackageReference Include="xunit.runner.console" Version="2.4.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\FluentCommandLineParser\FluentCommandLineParser.csproj" />
</ItemGroup>

</Project>
Loading