Skip to content

Commit

Permalink
refactor: Update CustomLinearCareTaskProgress (#15)
Browse files Browse the repository at this point in the history
* refactor: changed the title of OCKEventAggregator.swift to CareTaskProgressStrategy+Math
removed struct CustomLinearCareTaskProgress
removed all appearances of CustomLinearCareTaskProgress to LinearCareTaskProgress

* test: add new test cases for computeProgress functions
Add new test cases for `computeProgressByAveragingOutcomeValues`, `computeProgressByMedianOutcomeValues`, and `computeProgressByStreakOutcomeValues` functions in the `CareTaskProgressStrategy` class. Covers varioues edge cases and increases overall test coverage.

feat: add kind parameter to computeProgress functions

Add a new `kind` parameter to `computeProgressByAveragingOutcomeValues`, `computeProgressByMedianOutcomeValues`, and `computeProgressByStreakOutcomeValues` functions in the `CareTaskProgressStrategy` class. This allows calculating progress for a specific kind of outcome.

* refacor: removed force unwrapping
removes all instances of force unwrapping to prevent potential crashes.
style: remove underscores for function, remove unnecessary comments, and formatting.

* test: added test cases for kind field
Added unit test to verify the handling of different kinds the 'computeProgressByAveragingOutcomeValues' function.
refacor: simplified value extraction from OCKOutcomeValue
Replaced instances of $0.numberValue?.doubleValue with $0.doubleValue to remove unnecessary casting.
style: improved readibility by adding new lines

* fix: avoid force unwrapping  in progress calculation tests
Refactor tests to be able to unwrap optional values using guard statements
style: Reduced identation and also tab when needed
refactor: Use string variables for kinds to reduce programatic mistakes

* style: consistent styling format

* nits

* nits

* rename count to valueCount

* nit

* nits

* nits

---------

Co-authored-by: lmillan1 <[email protected]>
  • Loading branch information
luimillan3 and lmillan1 authored Jul 18, 2024
1 parent 094cf72 commit c09b894
Show file tree
Hide file tree
Showing 3 changed files with 847 additions and 101 deletions.
Loading

0 comments on commit c09b894

Please sign in to comment.