Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 5aafe52

Browse files
committed
Initial testing project
1 parent fd27c29 commit 5aafe52

File tree

5 files changed

+66
-2
lines changed

5 files changed

+66
-2
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using Xunit;
3+
using APIManagement.Template;
4+
using McMaster.Extensions.CommandLineUtils;
5+
6+
namespace apimtemplate.test
7+
{
8+
public class Create
9+
{
10+
11+
[Fact]
12+
public void ShouldFailWithUnknownCommand()
13+
{
14+
15+
var createCommand = new CreateCommand();
16+
17+
var ex = Assert.ThrowsAny<CommandParsingException>(() => createCommand.Execute("test"));
18+
//Console.WriteLine(ex.Message);
19+
Assert.Contains("Unrecognized command or argument 'test'", ex.Message);
20+
}
21+
}
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using Xunit;
3+
using APIManagement.Template;
4+
using McMaster.Extensions.CommandLineUtils;
5+
6+
7+
namespace apimtemplate.test
8+
{
9+
public class Extract
10+
{
11+
[Fact]
12+
public void ShouldFailWithUnknownCommand()
13+
{
14+
15+
var createCommand = new ExtractCommand();
16+
17+
var ex = Assert.ThrowsAny<CommandParsingException>(() => createCommand.Execute("test"));
18+
//Console.WriteLine(ex.Message);
19+
Assert.Contains("Unrecognized command or argument 'test'", ex.Message);
20+
}
21+
}
22+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp2.1</TargetFramework>
5+
6+
<IsPackable>false</IsPackable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<ProjectReference Include="..\..\src\apimtemplate\apimtemplate.csproj" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
15+
<PackageReference Include="moq" Version="4.10.1" />
16+
<PackageReference Include="xunit" Version="2.4.0" />
17+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
18+
</ItemGroup>
19+
20+
</Project>

src/apimtemplate/Commands/Create.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace APIManagement.Template
77
{
8-
internal class CreateCommand : CommandLineApplication
8+
public class CreateCommand : CommandLineApplication
99
{
1010
public CreateCommand()
1111
{

src/apimtemplate/Commands/Extract.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace APIManagement.Template
77
{
8-
internal class ExtractCommand : CommandLineApplication
8+
public class ExtractCommand : CommandLineApplication
99
{
1010
public ExtractCommand()
1111
{

0 commit comments

Comments
 (0)