-
Notifications
You must be signed in to change notification settings - Fork 407
Expand file tree
/
Copy pathAreaDensityTests.cs
More file actions
48 lines (39 loc) · 2.07 KB
/
AreaDensityTests.cs
File metadata and controls
48 lines (39 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated (once) by \generate-code.bat, but will not be
// regenerated when it already exists. The purpose of creating this file is to make
// it easier to remember to implement all the unit conversion test cases.
//
// Whenever a new unit is added to this quantity and \generate-code.bat is run,
// the base test class will get a new abstract property and cause a compile error
// in this derived class, reminding the developer to implement the test case
// for the new unit.
//
// 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 GeneratUnits.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 (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.
using System;
using Xunit;
namespace UnitsNet.Tests.CustomCode
{
public class AreaDensityTests : AreaDensityTestsBase
{
protected override double GramsPerSquareMeterInOneKilogramPerSquareMeter => 1000;
protected override double KilogramsPerSquareMeterInOneKilogramPerSquareMeter => 1;
protected override double MilligramsPerSquareMeterInOneKilogramPerSquareMeter => 1000000;
protected override double PoundPerSquareFootInOneKilogramPerSquareMeter => 1 / 4.8824;
protected override double PoundPerThousandSquareFeetInOneKilogramPerSquareMeter => 1000 / 4.8824;
[Fact]
public void AreaDensityTimesAreaEqualsMass()
{
Mass massOfOneA4Paper = AreaDensity.FromGramsPerSquareMeter(120) * Area.FromSquareCentimeters(625);
Assert.Equal(7.5, massOfOneA4Paper.Grams);
}
}
}