Skip to content

Commit

Permalink
Prefer top level statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
IEvangelist committed Mar 26, 2024
1 parent 2385c9b commit e338122
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 33 deletions.
4 changes: 3 additions & 1 deletion tests/ProfanityFilter.Action.Tests/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
global using Actions.Core.Summaries;

global using Microsoft.Extensions.DependencyInjection;

global using Microsoft.Testing.Framework;
global using Microsoft.Testing.Platform.Builder;
global using Microsoft.VisualStudio.TestTools.UnitTesting;

global using ProfanityFilter.Action.Clients;
global using ProfanityFilter.Action.Extensions;
global using ProfanityFilter.Action.Tests;

global using ProfanityFilter.Services;
global using ProfanityFilter.Services.Filters;
Expand Down
22 changes: 7 additions & 15 deletions tests/ProfanityFilter.Action.Tests/Program.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
// Copyright (c) David Pine. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Testing.Framework;
using Microsoft.Testing.Platform.Builder;
var builder = await TestApplication.CreateBuilderAsync(args);

namespace ProfanityFilter.Action.Tests;
// Registers TestFramework, with tree of test nodes
// that are generated into your project by source generator.
builder.AddTestFramework(new SourceGeneratedTestNodesBuilder());

internal static class Program
{
public static async Task<int> Main(string[] args)
{
var builder = await TestApplication.CreateBuilderAsync(args);
// Registers TestFramework, with tree of test nodes
// that are generated into your project by source generator.
builder.AddTestFramework(new SourceGeneratedTestNodesBuilder());
var app = await builder.BuildAsync();
return await app.RunAsync();
}
}
var app = await builder.BuildAsync();

return await app.RunAsync();
5 changes: 3 additions & 2 deletions tests/ProfanityFilter.Services.Tests/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
global using Microsoft.Extensions.Caching.Memory;
global using Microsoft.Extensions.DependencyInjection;
global using Microsoft.Extensions.Options;

global using Microsoft.Testing.Framework;
global using Microsoft.Testing.Platform.Builder;
global using Microsoft.VisualStudio.TestTools.UnitTesting;

global using ProfanityFilter.Services.Extensions;
global using ProfanityFilter.Services.Results;

global using ProfanityFilter.Services.Tests;
22 changes: 7 additions & 15 deletions tests/ProfanityFilter.Services.Tests/Program.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
// Copyright (c) David Pine. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Testing.Framework;
using Microsoft.Testing.Platform.Builder;
var builder = await TestApplication.CreateBuilderAsync(args);

namespace ProfanityFilter.Services.Tests;
// Registers TestFramework, with tree of test nodes
// that are generated into your project by source generator.
builder.AddTestFramework(new SourceGeneratedTestNodesBuilder());

internal static class Program
{
public static async Task<int> Main(string[] args)
{
var builder = await TestApplication.CreateBuilderAsync(args);
// Registers TestFramework, with tree of test nodes
// that are generated into your project by source generator.
builder.AddTestFramework(new SourceGeneratedTestNodesBuilder());
var app = await builder.BuildAsync();
return await app.RunAsync();
}
}
var app = await builder.BuildAsync();

return await app.RunAsync();

0 comments on commit e338122

Please sign in to comment.