Skip to content

Commit 381d84a

Browse files
committed
One test for each operation
1 parent 089f858 commit 381d84a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

UnitsNet.Tests/CustomCode/PowerTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,17 @@ public void PowerDividedBySpecificEnergyEqualsMassFlow()
129129
}
130130

131131
[Fact]
132-
public void CurrentMultipliedByPotentialEqualsPower()
132+
public void PowerDividedByElectricCurrentEqualsElectricPotential()
133133
{
134-
ElectricCurrent i = ElectricCurrent.FromAmperes(5);
135-
ElectricPotential u = ElectricPotential.FromVolts(10);
136-
Power p = Power.FromWatts(50);
137-
Assert.Equal(p, i * u);
138-
Assert.Equal(p, u * i);
139-
140-
// Validate the inverse is true as well
141-
Assert.Equal(i, p / u);
142-
Assert.Equal(u, p / i);
134+
ElectricPotential u = Power.FromWatts(10) / ElectricCurrent.FromAmperes(2);
135+
Assert.Equal(5, u.Volts);
136+
}
137+
138+
[Fact]
139+
public void PowerDividedByElectricPotentialEqualsElectricCurrent()
140+
{
141+
ElectricCurrent i = Power.FromWatts(20) / ElectricPotential.FromVolts(5);
142+
Assert.Equal(4, i.Amperes);
143143
}
144144
}
145145
}

0 commit comments

Comments
 (0)