fuseraft / fuseraft/fuseraft-cli

Add unit tests for ObjectivePlugin

Open
#115 0 comments 0 reactions 0 assignees View on GitHub
.NET good first issue
Dominant language
C#
Stars
4
Forks
4
Avg merge
22h 54m
Merged PRs (30d)
11

Description

`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).

Contributor guide

Open the contributing guide

Research direction

Start with src/Infrastructure/Plugins/ObjectivePlugin.cs and src/Infrastructure/Objectives/ObjectiveManager.cs, then use tests/FuseraftCli.Tests/TodoPluginTests.cs as the setup template. Construct the manager and ObjectiveStore using the established pattern, add coverage for the listed create, read, update, list, and link-task cases, and run the test project to confirm all behaviors pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
testing
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.