Skip to content

Commit d40fb8e

Browse files
baxcodersangularsen
authored andcommitted
Add BitRate (#383)
* Added physical quantity BitRate: Base: BitPerSecond (bit/s, bps) + Prefixes: "Kilo", "Mega", "Giga", "Tera", "Peta", "Exa", "Kibi", "Mebi", "Gibi", "Tebi", "Pebi", "Exbi" Additional: BytePerSecond (B/s) + Prefixes: "Kilo", "Mega", "Giga", "Tera", "Peta", "Exa", "Kibi", "Mebi", "Gibi", "Tebi", "Pebi", "Exbi"
1 parent 7f7d34c commit d40fb8e

File tree

8 files changed

+3435
-0
lines changed

8 files changed

+3435
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated (once) by \generate-code.bat, but will not be
4+
// regenerated when it already exists. The purpose of creating this file is to make
5+
// it easier to remember to implement all the unit conversion test cases.
6+
//
7+
// Whenever a new unit is added to this quantity and \generate-code.bat is run,
8+
// the base test class will get a new abstract property and cause a compile error
9+
// in this derived class, reminding the developer to implement the test case
10+
// for the new unit.
11+
//
12+
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
13+
//
14+
// Add CustomCode\Quantities\MyUnit.extra.cs files to add code to generated quantities.
15+
// Add Extensions\MyUnitExtensions.cs to decorate quantities with new behavior.
16+
// Add UnitDefinitions\MyUnit.json and run GeneratUnits.bat to generate new units or quantities.
17+
//
18+
// </auto-generated>
19+
//------------------------------------------------------------------------------
20+
21+
// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com).
22+
// https://github.com/angularsen/UnitsNet
23+
//
24+
// Permission is hereby granted, free of charge, to any person obtaining a copy
25+
// of this software and associated documentation files (the "Software"), to deal
26+
// in the Software without restriction, including without limitation the rights
27+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
28+
// copies of the Software, and to permit persons to whom the Software is
29+
// furnished to do so, subject to the following conditions:
30+
//
31+
// The above copyright notice and this permission notice shall be included in
32+
// all copies or substantial portions of the Software.
33+
//
34+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
40+
// THE SOFTWARE.
41+
42+
43+
using System;
44+
45+
namespace UnitsNet.Tests.CustomCode
46+
{
47+
public class BitRateTests : BitRateTestsBase
48+
{
49+
protected override double BitsPerSecondInOneBitPerSecond => 1d;
50+
protected override double BytesPerSecondInOneBitPerSecond => 1.25E-1d;
51+
52+
protected override double KilobitsPerSecondInOneBitPerSecond => 1E-3d;
53+
protected override double KilobytesPerSecondInOneBitPerSecond => 1.25E-4d;
54+
protected override double KibibitsPerSecondInOneBitPerSecond => 0.0009765625d;
55+
protected override double KibibytesPerSecondInOneBitPerSecond => 0.0001220703125d;
56+
57+
protected override double MegabitsPerSecondInOneBitPerSecond => 1E-6d;
58+
protected override double MegabytesPerSecondInOneBitPerSecond => 1.25E-07d;
59+
protected override double MebibitsPerSecondInOneBitPerSecond => 9.5367431640625E-07d;
60+
protected override double MebibytesPerSecondInOneBitPerSecond => 1.19209289550781E-07d;
61+
62+
protected override double GigabitsPerSecondInOneBitPerSecond => 1E-9d;
63+
protected override double GigabytesPerSecondInOneBitPerSecond => 1.25E-10d;
64+
protected override double GibibitsPerSecondInOneBitPerSecond => 9.31322574615479E-10d;
65+
protected override double GibibytesPerSecondInOneBitPerSecond => 1.16415321826935E-10d;
66+
67+
protected override double TerabitsPerSecondInOneBitPerSecond => 1E-12d;
68+
protected override double TerabytesPerSecondInOneBitPerSecond => 1.25E-13d;
69+
protected override double TebibitsPerSecondInOneBitPerSecond => 9.09494701772928E-13d;
70+
protected override double TebibytesPerSecondInOneBitPerSecond => 1.13686837721616E-13d;
71+
72+
protected override double PetabitsPerSecondInOneBitPerSecond => 1E-15d;
73+
protected override double PetabytesPerSecondInOneBitPerSecond => 1.25E-16d;
74+
protected override double PebibitsPerSecondInOneBitPerSecond => 8.88178419700125E-16d;
75+
protected override double PebibytesPerSecondInOneBitPerSecond => 1.11022302462516E-16d;
76+
77+
protected override double ExabitsPerSecondInOneBitPerSecond => 1E-18d;
78+
protected override double ExabytesPerSecondInOneBitPerSecond => 1.25E-19d;
79+
protected override double ExbibitsPerSecondInOneBitPerSecond => 8.67361738E-19d;
80+
protected override double ExbibytesPerSecondInOneBitPerSecond => 1.0842021724855E-19d;
81+
}
82+
}

0 commit comments

Comments
 (0)