Skip to content

Refactor PublishArtifactsInManifest and PublishArtifactsInManifestTests for better DI/mock support #2480

@missymessa

Description

@missymessa

A heavy amount of refactoring for DI (dependency injection) support was added to Arcade per dotnet/arcade#6672. Because of this, a lot of tasks were updated to use the DI because their dependencies were being refactored so that the MSBuild task that these tests were being built for could consume them through DI. PublishArtifactsInManifest was one of these tasks, and it should be refactored to follow better design patterns.

  • The method WhichPublishingTask is made public for testing. However, it has a dependency that is configured when the Execute method is called.
  • Currently, there are no mocks set up for these tests, and the fake model that is use doesn't contain all the pertinent information required to make the Execute method pass. So when the Execute method is called in the test in order to configure the dependencies through DI, the Execute method will return false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions