Skip to content

Add Scalar quantity #889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Common/UnitDefinitions/Scalar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"Name": "Scalar",
"BaseUnit": "Amount",
"XmlDoc": "A way of representing a number of items.",
"Units": [
{
"SingularName": "Amount",
"PluralName": "Amount",
"FromUnitToBaseFunc": "x",
"FromBaseToUnitFunc": "x",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "" ]
}
]
}
]
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions UnitsNet.Tests/CustomCode/ScalarTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by \generate-code.bat.
//
// Changes to this file will be lost when the code is regenerated.
// The build server regenerates the code before each build and a pre-build
// step will regenerate the code on each local build.
//
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
//
// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
//
// </auto-generated>
//------------------------------------------------------------------------------

// Licensed under MIT No Attribution, see LICENSE file at the root.
// Copyright 2013 Andreas Gullberg Larsen ([email protected]). Maintained at https://github.com/angularsen/UnitsNet.

using System;
using Xunit;

namespace UnitsNet.Tests.CustomCode
{
public class ScalarTests : ScalarTestsBase
{
// Override properties in base class here
protected override double AmountInOneAmount => 1;
protected override bool SupportsSIUnitSystem => false;

}
}
4 changes: 4 additions & 0 deletions UnitsNet.Tests/GeneratedCode/IQuantityTests.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading