Skip to content

Expand test coverage with edge cases, invalid inputs, and all configuration options #10

Description

@teesofttech

Description

The current test suite (CronCraft.Test/CronHelperTest.cs) covers only happy-path scenarios with default settings. Many important edge cases and configuration combinations are untested, which could hide bugs.

Missing Test Cases

Input Validation

  • Empty string input ("")
  • Null input (null)
  • Too few parts ("* * *" — 3 parts)
  • Too many parts ("* * * * * * * *" — 8 parts)
  • Wildcard-only expression ("* * * * *")
  • Invalid field values (e.g., "*/61 * * * *" — 61 minutes is invalid)
  • Invalid day value (e.g., "0 0 * * 8" — day 8 doesn't exist)

Day Name Formats

  • DayNameFormat = "full" — e.g., "Every Monday"
  • DayNameFormat = "short" — e.g., "Every Mon"
  • DayNameFormat = "single" — e.g., "Every M"
  • DayNameFormat = "custom" with a custom day name map

Localization

  • Spanish (es) output for at least 3 different cron patterns
  • French (fr) output for at least 3 different cron patterns
  • Unsupported/unknown language code falls back gracefully

Time Zone

  • Valid timezone conversion (UTC → specific timezone)
  • Invalid timezone string behavior

Cron Patterns

  • Specific month (e.g., "0 9 1 3 *") — verifies month is included in output
  • Both day-of-month and day-of-week set (e.g., "0 23 15 * 1")
  • Quartz 6-part expressions
  • Quartz 7-part expressions
  • Step values in minute and hour fields

Where to Look

  • CronCraft.Test/CronHelperTest.cs — add new test methods here

Acceptance Criteria

  • All listed test cases are implemented and passing
  • Each test has a clear name describing the scenario being tested
  • Tests use [ExpectedException] or Assert.ThrowsException for error cases
  • Test file remains organized

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions