Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Update CustomLinearCareTaskProgress (#15)
* 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