Skip to content

Add unit tests for ObjectivePlugin #115

Description

@fuseraft

ObjectivePlugin (https://github.com/fuseraft/fuseraft-cli/blob/main/src/Infrastructure/Plugins/ObjectivePlugin.cs) has no test file — there is no ObjectivePluginTests.cs under tests/FuseraftCli.Tests/.

It's a thin agent-facing wrapper around ObjectiveManager (https://github.com/fuseraft/fuseraft-cli/blob/main/src/Infrastructure/Objectives/ObjectiveManager.cs) that exposes long-horizon objective tracking: CreateAsync, ReadAsync, UpdateAsync, ListAsync, LinkTaskAsync. Same shape as TodoPlugin (which already has TodoPluginTests.cs), so that file is a solid template to copy the setup pattern from.

Good first areas to cover:

  • CreateAsync rejects an empty title (PluginResult.Error)
  • CreateAsync with a comma-separated tasks string populates remaining tasks
  • ReadAsync on an unknown ID returns PluginResult.NotFound
  • UpdateAsync only changes the fields passed (title/description/status), leaving others intact
  • ListAsync with a status filter only returns matching objectives, and returns NotFound when nothing matches
  • LinkTaskAsync with completed: true moves a task into CompletedTasks and recomputes PercentComplete; with completed: false it's a no-op add to RemainingTasks

ObjectiveManager takes an ObjectiveStore — check how TodoPluginTests.cs constructs its manager/store for the pattern to follow (likely a temp-directory-backed store).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .NET codegood first issueGood for newcomers

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions