Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 22, 2025

  • Rename SetUp to setup_before_each_test
  • Rename TearDown to teardown_after_each_test
  • Use 'using var host' pattern instead of manual dispose
  • Remove "Arrange", "Act", "Assert" comments
  • Use empty array initializer [] instead of Array.Empty()
  • Remove unnecessary appsettings.json file in env var test
  • Split priority test into two separate tests
  • All 347 tests passing (336 existing + 11 new)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits December 22, 2025 22:30
Co-authored-by: acraven <9272163+acraven@users.noreply.github.com>
Co-authored-by: acraven <9272163+acraven@users.noreply.github.com>
Co-authored-by: acraven <9272163+acraven@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for settings per environment Add tests for environment-specific configuration loading Dec 22, 2025
Copilot AI requested a review from acraven December 22, 2025 22:39
@acraven acraven changed the base branch from env-settings to main December 22, 2025 22:48
Copy link
Contributor

@acraven acraven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot looks good, I've made some comments

private string _originalDirectory;

[SetUp]
public void SetUp()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to setup_before_each_test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to setup_before_each_test in c6a9a4c

}

[TearDown]
public void TearDown()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to teardown_before_each_test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to teardown_after_each_test in c6a9a4c

{
// Get the application name prefix by creating a temporary host
// This is needed because the prefix is based on the application name with dots removed
var tempHost = new HostBuilder()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just name this host. But as with each other instance, can you use using var host instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to use 'using var host' pattern throughout all tests in c6a9a4c

[Test]
public void should_load_base_appsettings_json()
{
// Arrange
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't usually name Arrange, Act and Assert blocks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed Arrange, Act, and Assert comments from all tests in c6a9a4c


// Act
var host = new HostBuilder()
.UseDefaultBuilder(Array.Empty<string>())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use empty array initializer instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to use empty array initializer [] throughout in c6a9a4c

public void should_load_environment_variables_with_app_prefix()
{
// Arrange
var appSettingsPath = Path.Combine(_testDirectory, "appsettings.json");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the appsettings.json file is relevant to the test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the unnecessary appsettings.json file from the environment variable test in c6a9a4c

}

[Test]
public void should_prioritize_configuration_sources_correctly()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is 2 separate tests; one to check env vars override appsettings and another to check command line args override env vars

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split into two separate tests: should_override_appsettings_with_environment_variables and should_override_environment_variables_with_command_line_arguments in c6a9a4c

@acraven acraven changed the title Add tests for environment-specific configuration loading Add support for configuration settings per environment Dec 22, 2025
… comments, split test

Co-authored-by: acraven <9272163+acraven@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 22, 2025

@copilot looks good, I've made some comments

All feedback addressed in c6a9a4c:

  • Renamed test lifecycle methods
  • Used 'using var' pattern for resource management
  • Removed section comments
  • Used empty array initializer syntax
  • Removed unnecessary test file
  • Split combined priority test into two focused tests

All 347 tests passing.

Copilot AI requested a review from acraven December 22, 2025 23:12
@acraven acraven marked this pull request as ready for review December 24, 2025 00:17
Copy link
Contributor

@acraven acraven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@acraven acraven merged commit 2dc6bdc into main Dec 24, 2025
1 check passed
@acraven acraven deleted the copilot/sub-pr-83 branch December 24, 2025 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants