Skip to content
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
68 changes: 0 additions & 68 deletions UnitsNet.Tests/DecimalOverloadTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,6 @@ public static void CreatingQuantityWithDoubleBackingFieldFromDecimalReturnsCorre
Assert.Equal(1.0, acceleration.MetersPerSecondSquared);
}

[Fact]
public static void CreatingQuantityWithDoubleBackingFieldFromNullableDecimalReturnsCorrectValue()
{
decimal? oneMeterPerSecondSquared = 1m;
Acceleration? acceleration = Acceleration.FromMetersPerSecondSquared(oneMeterPerSecondSquared);
Assert.NotNull(acceleration);
Assert.Equal(1.0, acceleration.Value.MetersPerSecondSquared);
}

[Fact]
public static void CreatingQuantityWithDoubleBackingFieldFromNullableDecimalReturnsNullWhenGivenNull()
{
decimal? nullDecimal = null;
Acceleration? acceleration = Acceleration.FromMetersPerSecondSquared(nullDecimal);
Assert.Null(acceleration);
}

[Fact]
public static void CreatingQuantityWithDoubleBackingFieldFromDecimalWithExtensionMethodReturnsCorrectValue()
{
Expand All @@ -60,23 +43,6 @@ public static void CreatingQuantityWithDoubleBackingFieldFromDecimalWithExtensio
Assert.Equal(1.0, acceleration.MetersPerSecondSquared);
}

[Fact]
public static void CreatingQuantityWithDoubleBackingFieldFromNullableDecimalWithExtensionMethodReturnsCorrectValue()
{
decimal? oneMeterPerSecondSquared = 1m;
Acceleration? acceleration = oneMeterPerSecondSquared.MetersPerSecondSquared();
Assert.NotNull(acceleration);
Assert.Equal(1.0, acceleration.Value.MetersPerSecondSquared);
}

[Fact]
public static void CreatingQuantityWithDoubleBackingFieldFromNullableDecimalWithExtensionMethodReturnsNullWhenGivenNull()
{
decimal? nullDecimal = null;
Acceleration? acceleration = nullDecimal.MetersPerSecondSquared();
Assert.Null(acceleration);
}

[Fact]
public static void CreatingQuantityWithDecimalBackingFieldFromDecimalReturnsCorrectValue()
{
Expand All @@ -85,46 +51,12 @@ public static void CreatingQuantityWithDecimalBackingFieldFromDecimalReturnsCorr
Assert.Equal(1.0, power.Watts);
}

[Fact]
public static void CreatingQuantityWithDecimalBackingFieldFromNullableDecimalReturnsCorrectValue()
{
decimal? oneWatt = 1m;
Power? power = Power.FromWatts(oneWatt);
Assert.NotNull(power);
Assert.Equal(1.0, power.Value.Watts);
}

[Fact]
public static void CreatingQuantityWithDecimalBackingFieldFromNullableDecimalReturnsNullWhenGivenNull()
{
decimal? nullDecimal = null;
Power? power = Power.FromWatts(nullDecimal);
Assert.Null(power);
}

[Fact]
public static void CreatingQuantityWithDecimalBackingFieldFromDecimalWithExtensionMethodReturnsCorrectValue()
{
decimal oneWatt = 1m;
Power power = oneWatt.Watts();
Assert.Equal(1.0, power.Watts);
}

[Fact]
public static void CreatingQuantityWithDecimalBackingFieldFromNullableDecimalWithExtensionMethodReturnsCorrectValue()
{
decimal? oneWatt = 1m;
Power? power = oneWatt.Watts();
Assert.NotNull(power);
Assert.Equal(1.0, power.Value.Watts);
}

[Fact]
public static void CreatingQuantityWithDecimalBackingFieldFromNullableDecimalWithExtensionMethodReturnsNullWhenGivenNull()
{
decimal? nullDecimal = null;
Power? power = nullDecimal.Watts();
Assert.Null(power);
}
}
}
68 changes: 0 additions & 68 deletions UnitsNet.Tests/IntOverloadTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,6 @@ public static void CreatingQuantityWithDoubleBackingFieldFromIntReturnsCorrectVa
Assert.Equal(1.0, acceleration.MetersPerSecondSquared);
}

[Fact]
public static void CreatingQuantityWithDoubleBackingFieldFromNullableIntReturnsCorrectValue()
{
int? oneMeterPerSecondSquared = 1;
Acceleration? acceleration = Acceleration.FromMetersPerSecondSquared(oneMeterPerSecondSquared);
Assert.NotNull(acceleration);
Assert.Equal(1.0, acceleration.Value.MetersPerSecondSquared);
}

[Fact]
public static void CreatingQuantityWithDoubleBackingFieldFromNullableIntReturnsNullWhenGivenNull()
{
int? nullInt = null;
Acceleration? acceleration = Acceleration.FromMetersPerSecondSquared(nullInt);
Assert.Null(acceleration);
}

[Fact]
public static void CreatingQuantityWithDoubleBackingFieldFromIntWithExtensionMethodReturnsCorrectValue()
{
Expand All @@ -60,23 +43,6 @@ public static void CreatingQuantityWithDoubleBackingFieldFromIntWithExtensionMet
Assert.Equal(1.0, acceleration.MetersPerSecondSquared);
}

[Fact]
public static void CreatingQuantityWithDoubleBackingFieldFromNullableIntWithExtensionMethodReturnsCorrectValue()
{
int? oneMeterPerSecondSquared = 1;
Acceleration? acceleration = oneMeterPerSecondSquared.MetersPerSecondSquared();
Assert.NotNull(acceleration);
Assert.Equal(1.0, acceleration.Value.MetersPerSecondSquared);
}

[Fact]
public static void CreatingQuantityWithDoubleBackingFieldFromNullableIntWithExtensionMethodReturnsNullWhenGivenNull()
{
int? nullInt = null;
Acceleration? acceleration = nullInt.MetersPerSecondSquared();
Assert.Null(acceleration);
}

[Fact]
public static void CreatingQuantityWithIntBackingFieldFromIntReturnsCorrectValue()
{
Expand All @@ -85,46 +51,12 @@ public static void CreatingQuantityWithIntBackingFieldFromIntReturnsCorrectValue
Assert.Equal(1.0, power.Watts);
}

[Fact]
public static void CreatingQuantityWithIntBackingFieldFromNullableIntReturnsCorrectValue()
{
int? oneWatt = 1;
Power? power = Power.FromWatts(oneWatt);
Assert.NotNull(power);
Assert.Equal(1.0, power.Value.Watts);
}

[Fact]
public static void CreatingQuantityWithIntBackingFieldFromNullableIntReturnsNullWhenGivenNull()
{
int? nullInt = null;
Power? power = Power.FromWatts(nullInt);
Assert.Null(power);
}

[Fact]
public static void CreatingQuantityWithIntBackingFieldFromIntWithExtensionMethodReturnsCorrectValue()
{
int oneWatt = 1;
Power power = oneWatt.Watts();
Assert.Equal(1.0, power.Watts);
}

[Fact]
public static void CreatingQuantityWithIntBackingFieldFromNullableIntWithExtensionMethodReturnsCorrectValue()
{
int? oneWatt = 1;
Power? power = oneWatt.Watts();
Assert.NotNull(power);
Assert.Equal(1.0, power.Value.Watts);
}

[Fact]
public static void CreatingQuantityWithIntBackingFieldFromNullableIntWithExtensionMethodReturnsNullWhenGivenNull()
{
int? nullInt = null;
Power? power = nullInt.Watts();
Assert.Null(power);
}
}
}
68 changes: 0 additions & 68 deletions UnitsNet.Tests/LongOverloadTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,6 @@ public static void CreatingQuantityWithDoubleBackingFieldFromLongReturnsCorrectV
Assert.Equal(1.0, acceleration.MetersPerSecondSquared);
}

[Fact]
public static void CreatingQuantityWithDoubleBackingFieldFromNullableLongReturnsCorrectValue()
{
long? oneMeterPerSecondSquared = 1;
Acceleration? acceleration = Acceleration.FromMetersPerSecondSquared(oneMeterPerSecondSquared);
Assert.NotNull(acceleration);
Assert.Equal(1.0, acceleration.Value.MetersPerSecondSquared);
}

[Fact]
public static void CreatingQuantityWithDoubleBackingFieldFromNullableLongReturnsNullWhenGivenNull()
{
long? nullLong = null;
Acceleration? acceleration = Acceleration.FromMetersPerSecondSquared(nullLong);
Assert.Null(acceleration);
}

[Fact]
public static void CreatingQuantityWithDoubleBackingFieldFromLongWithExtensionMethodReturnsCorrectValue()
{
Expand All @@ -60,23 +43,6 @@ public static void CreatingQuantityWithDoubleBackingFieldFromLongWithExtensionMe
Assert.Equal(1.0, acceleration.MetersPerSecondSquared);
}

[Fact]
public static void CreatingQuantityWithDoubleBackingFieldFromNullableLongWithExtensionMethodReturnsCorrectValue()
{
long? oneMeterPerSecondSquared = 1;
Acceleration? acceleration = oneMeterPerSecondSquared.MetersPerSecondSquared();
Assert.NotNull(acceleration);
Assert.Equal(1.0, acceleration.Value.MetersPerSecondSquared);
}

[Fact]
public static void CreatingQuantityWithDoubleBackingFieldFromNullableLongWithExtensionMethodReturnsNullWhenGivenNull()
{
long? nullLong = null;
Acceleration? acceleration = nullLong.MetersPerSecondSquared();
Assert.Null(acceleration);
}

[Fact]
public static void CreatingQuantityWithLongBackingFieldFromLongReturnsCorrectValue()
{
Expand All @@ -85,46 +51,12 @@ public static void CreatingQuantityWithLongBackingFieldFromLongReturnsCorrectVal
Assert.Equal(1.0, power.Watts);
}

[Fact]
public static void CreatingQuantityWithLongBackingFieldFromNullableLongReturnsCorrectValue()
{
long? oneWatt = 1;
Power? power = Power.FromWatts(oneWatt);
Assert.NotNull(power);
Assert.Equal(1.0, power.Value.Watts);
}

[Fact]
public static void CreatingQuantityWithLongBackingFieldFromNullableLongReturnsNullWhenGivenNull()
{
long? nullLong = null;
Power? power = Power.FromWatts(nullLong);
Assert.Null(power);
}

[Fact]
public static void CreatingQuantityWithLongBackingFieldFromLongWithExtensionMethodReturnsCorrectValue()
{
long oneWatt = 1;
Power power = oneWatt.Watts();
Assert.Equal(1.0, power.Watts);
}

[Fact]
public static void CreatingQuantityWithLongBackingFieldFromNullableLongWithExtensionMethodReturnsCorrectValue()
{
long? oneWatt = 1;
Power? power = oneWatt.Watts();
Assert.NotNull(power);
Assert.Equal(1.0, power.Value.Watts);
}

[Fact]
public static void CreatingQuantityWithLongBackingFieldFromNullableLongWithExtensionMethodReturnsNullWhenGivenNull()
{
long? nullLong = null;
Power? power = nullLong.Watts();
Assert.Null(power);
}
}
}
90 changes: 0 additions & 90 deletions UnitsNet.Tests/NullableConstructors.cs

This file was deleted.

Loading