Skip to content
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

Refactor SimpleContainer tests and improve code quality #959

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

vb2ae
Copy link
Member

@vb2ae vb2ae commented Dec 21, 2024

Refactored SimpleContainerTests.cs into multiple files for better modularity and readability. Updated SimpleContainer.cs for performance and readability improvements. Added new test files for various aspects of SimpleContainer functionality. Created new service files to support tests. These changes enhance the structure, readability, and maintainability of the codebase.

Prevent caliburn.micro.platform.core from creating a nuget package

Update dependabot.yml to look at src directory

Closes #958

Refactored SimpleContainerTests.cs into multiple files for better modularity and readability. Updated SimpleContainer.cs for performance and readability improvements. Added new test files for various aspects of SimpleContainer functionality. Created new service files to support tests. These changes enhance the structure, readability, and maintainability of the codebase.
@vb2ae vb2ae linked an issue Dec 21, 2024 that may be closed by this pull request
1 task
@vb2ae vb2ae requested a review from Copilot December 21, 2024 14:36

Choose a reason for hiding this comment

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

Copilot reviewed 11 out of 26 changed files in this pull request and generated no comments.

Files not reviewed (15)
  • src/Caliburn.Micro.Core.Tests/Services/EnumerableDependency2.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/EnumerableDependency1.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/Dependency1.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/Component.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/TestService.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/Dependency2.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/SecondDependency1.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/SingleIntConstructor.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/IDependency2.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/NonInterfaceDependency.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/IDependency1.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/IEnumerableDependency.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/SingleNonEmptyConstructorType.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/TestServiceWithDependency.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/ITestService.cs: Evaluated as low risk
Comments suppressed due to low confidence (9)

src/Caliburn.Micro.Core.Tests/SimpleContainerCheckingForHandler.cs:9

  • [nitpick] The method name 'HasHandler_returns_false_when_handler_does_not_exist' uses underscores to separate words. For consistency, consider using camelCase or PascalCase for method names.
public void HasHandler_returns_false_when_handler_does_not_exist()

src/Caliburn.Micro.Core.Tests/SimpleContainerCheckingForHandler.cs:16

  • [nitpick] The method name 'HasHandler_returns_true_when_handler_exists' uses underscores to separate words. For consistency, consider using camelCase or PascalCase for method names.
public void HasHandler_returns_true_when_handler_exists()

src/Caliburn.Micro.Core.Tests/SimpleContainerCheckingForHandler.cs:26

  • [nitpick] The method name 'GetInstance_ShouldReturnNullIfNoHandler' uses PascalCase and underscores. For consistency, consider using camelCase or PascalCase without underscores for method names.
public void GetInstance_ShouldReturnNullIfNoHandler()

src/Caliburn.Micro.Core.Tests/SimpleContainerCheckingForHandler.cs:36

  • [nitpick] The method name 'HasHandler_ShouldReturnTrueIfHandlerExists' uses PascalCase and underscores. For consistency, consider using camelCase or PascalCase without underscores for method names.
public void HasHandler_ShouldReturnTrueIfHandlerExists()

src/Caliburn.Micro.Core.Tests/SimpleContainerCheckingForHandler.cs:49

  • [nitpick] The method name 'HasHandler_ShouldReturnFalseIfHandlerDoesNotExist' uses PascalCase and underscores. For consistency, consider using camelCase or PascalCase without underscores for method names.
public void HasHandler_ShouldReturnFalseIfHandlerDoesNotExist()

src/Caliburn.Micro.Core.Tests/SimpleContainerCreatingAChildContainer.cs:7

  • [nitpick] The method name 'Singleton_instances_are_the_same_across_parent_and_child' is verbose and not in camel case. Consider renaming it to 'SingletonInstancesAreTheSameAcrossParentAndChild'.
[Fact]
public void Singleton_instances_are_the_same_across_parent_and_child()

src/Caliburn.Micro.Core.Tests/SimpleContainerCreatingAChildContainer.cs:20

  • [nitpick] The method name 'The_child_container_returned_contains_parent_entries' is verbose and not in camel case. Consider renaming it to 'ChildContainerContainsParentEntries'.
[Fact]
public void The_child_container_returned_contains_parent_entries()

src/Caliburn.Micro.Core.Tests/SimpleContainerCreatingAChildContainer.cs:30

  • [nitpick] The method name 'The_child_container_returned_is_not_the_same_instance_as_its_parent' is verbose and not in camel case. Consider renaming it to 'ChildContainerIsNotSameInstanceAsParent'.
[Fact]
public void The_child_container_returned_is_not_the_same_instance_as_its_parent()
Renamed test methods in SimpleContainerCheckingForHandler.cs to follow a consistent naming convention. Removed underscores and converted names to camel case.
@vb2ae vb2ae requested review from KasperSK and Copilot December 23, 2024 03:08
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 11 out of 26 changed files in this pull request and generated 1 comment.

Files not reviewed (15)
  • src/Caliburn.Micro.Core.Tests/Services/EnumerableDependency1.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/EnumerableDependency2.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/Dependency2.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/Dependency1.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/Component.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/SingleIntConstructor.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/SecondDependency1.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/TestServiceWithDependency.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/IDependency2.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/IEnumerableDependency.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/TestService.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/SingleNonEmptyConstructorType.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/IDependency1.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/NonInterfaceDependency.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/SingleEmptyConstructorType.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)

src/Caliburn.Micro.Core.Tests/SimpleContainerCreatingAChildContainer.cs:21

  • [nitpick] The method name 'The_child_container_returned_contains_parent_entries' is inconsistent with the naming convention used in other test methods. It should be 'ChildContainerContainsParentEntries'.
public void The_child_container_returned_contains_parent_entries()

@vb2ae vb2ae requested a review from Copilot December 23, 2024 03:12

Choose a reason for hiding this comment

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

Copilot reviewed 11 out of 26 changed files in this pull request and generated no comments.

Files not reviewed (15)
  • src/Caliburn.Micro.Core.Tests/Services/Component.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/Dependency1.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/Dependency2.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/EnumerableDependency1.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/EnumerableDependency2.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/IComponent.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/IDependency1.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/IDependency2.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/SimpleContainerCreatingAChildContainer.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/SimpleContainerCheckingForHandler.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/TwoConstructors.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/TestServiceWithDependency.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/TestService.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/SecondDependency1.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/NonInterfaceDependency.cs: Evaluated as low risk
@vb2ae vb2ae requested a review from Copilot December 24, 2024 14:13

Choose a reason for hiding this comment

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

Copilot reviewed 13 out of 28 changed files in this pull request and generated no comments.

Files not reviewed (15)
  • src/Caliburn.Micro.Core.Tests/Services/IEnumerableDependency.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/SingleIntConstructor.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/SingleEmptyConstructorType.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/SecondDependency1.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/NonInterfaceDependency.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/ITestService.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/IDependency1.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/IDependency2.cs: Evaluated as low risk
  • .github/dependabot.yml: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/EnumerableDependency2.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/Component.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/EnumerableDependency1.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/Dependency2.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/Dependency1.cs: Evaluated as low risk
  • src/Caliburn.Micro.Core.Tests/Services/TestService.cs: Evaluated as low risk
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.

Fix code scanning alert - Missed opportunity to use Where
1 participant