Skip to content

Measurement system is not static singleton anymore#5

Open
Shiko1st wants to merge 2 commits into
point85:masterfrom
Shiko1st:feature/nosingleton
Open

Measurement system is not static singleton anymore#5
Shiko1st wants to merge 2 commits into
point85:masterfrom
Shiko1st:feature/nosingleton

Conversation

@Shiko1st

Copy link
Copy Markdown
Collaborator

Motivation: In our multitenant app we need an independent instance of MeasurementSystem for each tenant.

What have been done:

  • All static access to default measurement system removed.
  • Subsequently, UnitOfMeasure has been adapted to this situation and contains a reference to an instance of a parent MeasurementSystem object.
  • Quantity is now struct (this improves performance and memory use in case of intense calculations).
  • Overloaded operators were added to Quantity. This allows to use expressions like q1 + q2 instead of q1.Add(q2).
  • Quantity implements IEquatable<> and IComparable<> with Quantity and double.
  • Fixed problem with missed png file (the file was located outside of solution).

Breaking changes:

  • No UOM-less quantities could be created.

Quantity is now struct.
Operators overloading is added to Quantity.
Fixed problem with missed png file.
@point85

point85 commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Hello Shiko1st,
This is a great enhancement! I noticed that you edited the unit test files too. Before merging your changes, I would like you to verify that all of the previous unit tests pass, and any new ones that you might have written also pass.
Regards,
Kent Randall

@point85

point85 commented Jul 21, 2026

Copy link
Copy Markdown
Owner

P.S. Do you want to become a maintainer of this project?

@Shiko1st

Copy link
Copy Markdown
Collaborator Author

P.S. Do you want to become a maintainer of this project?

Hi Kent, yes, if possible. I have a local corporate fork, however, it would be better to use the single repo.

@Shiko1st

Shiko1st commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

I noticed that you edited the unit test files too.

Unit tests were fixed in cases where the old-style singleton approach was used. The tests logic was not changed.

I would like you to verify that all of the previous unit tests pass, and any new ones that you might have written also pass.

Locally and on our build server all tests pass. Are there any failed tests on your side? I'm not sure what CI/CD process do you use, it seems no automatic runner here in github. Am I miss something?

I will also add some new tests later with a separate commit.

Operators and sorting tests.
@point85

point85 commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Shiko1st,
You should now be a contributor. Do I need to merge your pull request or can you do it?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants