Skip to content

Commit

Permalink
Merge pull request #496 from bilal-fazlani/centralize-package-mgmt
Browse files Browse the repository at this point in the history
Centralize package management, update nugets, and other minor maintenance
  • Loading branch information
drewburlingame authored Apr 29, 2024
2 parents 3cbdd23 + 34f93f5 commit 59a3797
Show file tree
Hide file tree
Showing 40 changed files with 146 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.Arguments.Arguments
Expand Down Expand Up @@ -269,6 +270,6 @@ public IEnumerable<ValidationResult> Validate(ValidationContext validationContex
@"CommandDotNet.InvalidConfigurationException: Operand property must be attributed with OperandAttribute or OrderByPositionInClassAttribute to guarantee consistent order. Properties:
CommandDotNet.DocExamples.Arguments.Arguments.Argument_Models+Program_WithInvalidhNestedOperands+NotifyModel.NotificationArgs");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.Arguments.Arguments
Expand Down Expand Up @@ -33,6 +34,6 @@ public class Username
new AppRunner<Program>(), "myapp.exe", "Login roy rogers", 0,
@"u:roy p:*****");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.Arguments.Arguments
Expand Down Expand Up @@ -132,6 +133,6 @@ public void DefaultCommand(
"app.exe", "-b true -b true -u http://google.com -u http://google.com", 0,
"");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using CommandDotNet.TestTools;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.Arguments.Arguments
Expand Down Expand Up @@ -87,6 +88,6 @@ Abort the launch before takeoff
"mission-control.exe", "LaunchRocket -turbo -a true mars", 0,
"planet=mars turbo=True abort=True");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.Arguments.Arguments
Expand Down Expand Up @@ -77,6 +78,6 @@ public void LaunchRocket(IConsole console, CommandContext ctx,
crew: alex
separated: additional,args,here");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
3 changes: 2 additions & 1 deletion CommandDotNet.DocExamples/Arguments/Arguments/Passwords.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using CommandDotNet.Prompts;
using CommandDotNet.TestTools.Prompts;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.Arguments.Arguments
Expand Down Expand Up @@ -38,6 +39,6 @@ public void Prompt(IConsole console, IPrompter prompter, string username)
u:roy p:rogers",
promptAnswers: new IAnswer[]{ new Answer("rogers") });

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.ComponentModel.DataAnnotations;
using CommandDotNet.DataAnnotations;
using CommandDotNet.NameCasing;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.Arguments.Validation
Expand Down Expand Up @@ -77,6 +78,6 @@ public IEnumerable<ValidationResult> Validate(ValidationContext validationContex
'owner' is not a valid e-mail address.
quiet and verbose are mutually exclusive. There can be only one!");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using CommandDotNet.FluentValidation;
using CommandDotNet.NameCasing;
using FluentAssertions;
using FluentValidation;
using FluentValidation.Results;
using NUnit.Framework;
Expand Down Expand Up @@ -126,6 +127,6 @@ The length of 'Name' must be 10 characters or fewer. You entered 16 characters.
'Verbosity' is invalid
quiet and verbose are mutually exclusive. There can be only one!");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.Arguments.Values
Expand Down Expand Up @@ -110,6 +111,6 @@ public void Ignore(){ }
separated: pass-thru
remaining:");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.Arguments.Values
Expand Down Expand Up @@ -132,6 +133,6 @@ disabled b1 Beatrix (inactive)",
notify: b1 Beatrix (active)",
pipedInput: ("users.exe list -i", Program.userSvc.GetUsers().Select(u => u.Id).ToArray()));

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
2 changes: 0 additions & 2 deletions CommandDotNet.DocExamples/BashSnippet.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using CommandDotNet.TestTools.Prompts;
using NuGet.Frameworks;

namespace CommandDotNet.DocExamples
{
Expand Down
12 changes: 6 additions & 6 deletions CommandDotNet.DocExamples/CommandDotNet.DocExamples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.2.0" />
<PackageReference Include="FluentValidation" Version="10.3.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.1.0" />
<PackageReference Include="coverlet.collector" Version="3.0.2" />
<PackageReference Include="FluentAssertions" />
<PackageReference Include="FluentValidation" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="coverlet.collector" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.Commands.Commands
Expand Down Expand Up @@ -35,6 +36,6 @@ public void Subtract(IConsole console, int x, int y) =>
more details and examples could be provided here");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
3 changes: 2 additions & 1 deletion CommandDotNet.DocExamples/Commands/Commands/Commands_Git.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using CommandDotNet.NameCasing;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.Commands.Commands
Expand Down Expand Up @@ -30,7 +31,7 @@ public class Stash
public static BashSnippet Pop = new("commands_2_git_pop",
Program.AppRunner, "git", "stash pop", 0, "pop");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using CommandDotNet.NameCasing;
using CommandDotNet.TestTools;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.Commands.Subcommands
Expand Down Expand Up @@ -88,6 +89,6 @@ pop Applies last stashed changes
Use ""git.exe stash [command] --help"" for more information about a command.");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using CommandDotNet.NameCasing;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.Commands.Subcommands
Expand Down Expand Up @@ -58,6 +59,6 @@ stash Stashes all changes when executed without any arguments
Use ""git.exe [command] --help"" for more information about a command.");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Threading.Tasks;
using CommandDotNet.DataAnnotations;
using CommandDotNet.NameCasing;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.DataAnnotations
Expand Down Expand Up @@ -87,6 +88,6 @@ public IEnumerable<ValidationResult> Validate(ValidationContext validationContex
'name' must be a string or array type with a maximum length of '10'.
'owner' is not a valid e-mail address.");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
3 changes: 2 additions & 1 deletion CommandDotNet.DocExamples/Diagnostics/Command_Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using CommandDotNet.Diagnostics;
using CommandDotNet.Extensions;
using CommandDotNet.TestTools;
using FluentAssertions;

namespace CommandDotNet.DocExamples.Diagnostics
{
Expand Down Expand Up @@ -338,6 +339,6 @@ public Task<int> Interceptor(InterceptorExecutionDelegate next, CommandContext c
***************************************
2");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
9 changes: 5 additions & 4 deletions CommandDotNet.DocExamples/Diagnostics/Exceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using NUnit.Framework;
using CommandDotNet.Diagnostics;
using CommandDotNet.TestTools;
using FluentAssertions;

namespace CommandDotNet.DocExamples.Diagnostics
{
Expand Down Expand Up @@ -224,16 +225,16 @@ Throw yikes
public void UseErrorHandler_Delegate_works()
{
var (exitCode, output) = typeof(Program_UseErrorHandler_Delegate.Program).InvokeMainMethod("Throw yikes");
Assert.AreEqual(1, exitCode);
Assert.AreEqual($"yikes (Parameter 'message'){Environment.NewLine}", output);
exitCode.Should().Be(1);
output.Should().Be($"yikes (Parameter 'message'){Environment.NewLine}");
}

[Test]
public void TryCatch_works()
{
var (exitCode, output) = typeof(Program_TryCatch.Program).InvokeMainMethod("Throw yikes");
Assert.AreEqual(1, exitCode);
Assert.AreEqual($"yikes (Parameter 'message'){Environment.NewLine}", output);
exitCode.Should().Be(1);
output.Should().Be($"yikes (Parameter 'message'){Environment.NewLine}");
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using CommandDotNet.TestTools;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.GettingStarted
Expand Down Expand Up @@ -99,6 +100,6 @@ public class Subtract
"dotnet calculator.dll", "Add 40 20", 0,
@"60");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Threading.Tasks;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.GettingStarted
Expand Down Expand Up @@ -112,6 +113,6 @@ private string BuildBasicAuthUri(Uri uri)
"dotnet curl.dll", "-u me -p pwd Get http://mysite.com -v", 0,
@"[GET] http://me:*****@mysite.com/ verbose=True");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.GettingStarted
Expand Down Expand Up @@ -54,6 +55,6 @@ public void Sum(IConsole console, IEnumerable<int> values)
6
10");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using FluentAssertions;
using NUnit.Framework;

namespace CommandDotNet.DocExamples.GettingStarted
Expand Down Expand Up @@ -54,6 +55,6 @@ public void Sum(IConsole console, CancellationToken ct, IEnumerable<int> values)
6
10");

[Test] public void Obligatory_test_since_snippets_cover_all_cases() => Assert.True(true);
[Test] public void Obligatory_test_since_snippets_cover_all_cases() => true.Should().BeTrue();
}
}
Loading

0 comments on commit 59a3797

Please sign in to comment.