diff --git a/CodeGen/CodeGen.csproj b/CodeGen/CodeGen.csproj
index 9f62eb8fad..3424b96272 100644
--- a/CodeGen/CodeGen.csproj
+++ b/CodeGen/CodeGen.csproj
@@ -10,10 +10,10 @@
-
-
-
-
+
+
+
+
diff --git a/UnitsNet.Benchmark/UnitsNet.Benchmark.csproj b/UnitsNet.Benchmark/UnitsNet.Benchmark.csproj
index f996561b42..5a90114f34 100644
--- a/UnitsNet.Benchmark/UnitsNet.Benchmark.csproj
+++ b/UnitsNet.Benchmark/UnitsNet.Benchmark.csproj
@@ -10,8 +10,8 @@
-
-
+
+
all
diff --git a/UnitsNet.NumberExtensions.Tests/UnitsNet.NumberExtensions.Tests.csproj b/UnitsNet.NumberExtensions.Tests/UnitsNet.NumberExtensions.Tests.csproj
index bbe44eb686..e655661336 100644
--- a/UnitsNet.NumberExtensions.Tests/UnitsNet.NumberExtensions.Tests.csproj
+++ b/UnitsNet.NumberExtensions.Tests/UnitsNet.NumberExtensions.Tests.csproj
@@ -25,10 +25,10 @@
-
-
-
-
+
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/UnitsNet.Serialization.JsonNet.Tests/UnitsNet.Serialization.JsonNet.Tests.csproj b/UnitsNet.Serialization.JsonNet.Tests/UnitsNet.Serialization.JsonNet.Tests.csproj
index 6bf0289d9d..17e328ca10 100644
--- a/UnitsNet.Serialization.JsonNet.Tests/UnitsNet.Serialization.JsonNet.Tests.csproj
+++ b/UnitsNet.Serialization.JsonNet.Tests/UnitsNet.Serialization.JsonNet.Tests.csproj
@@ -14,9 +14,9 @@
-
-
-
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/UnitsNet.Serialization.JsonNet/UnitsNet.Serialization.JsonNet.csproj b/UnitsNet.Serialization.JsonNet/UnitsNet.Serialization.JsonNet.csproj
index 7b66839811..2f072f0590 100644
--- a/UnitsNet.Serialization.JsonNet/UnitsNet.Serialization.JsonNet.csproj
+++ b/UnitsNet.Serialization.JsonNet/UnitsNet.Serialization.JsonNet.csproj
@@ -48,9 +48,9 @@
-
-
-
+
+
+
diff --git a/UnitsNet.Tests/CustomCode/ParseTests.cs b/UnitsNet.Tests/CustomCode/ParseTests.cs
index 9bb2f3f302..1d0c27530a 100644
--- a/UnitsNet.Tests/CustomCode/ParseTests.cs
+++ b/UnitsNet.Tests/CustomCode/ParseTests.cs
@@ -39,10 +39,10 @@ public void ParseLengthToMetersUsEnglish(string s, double expected)
[InlineData("1 kg", typeof(FormatException))] // Wrong measurement type.
[InlineData("1ft monkey 1in", typeof(FormatException))] // Invalid separator between two valid measurements.
[InlineData("1ft 1invalid", typeof(FormatException))] // Valid
- public void ParseLength_InvalidString_USEnglish_ThrowsException(string s, Type expectedExceptionType)
+ public void ParseLength_InvalidString_USEnglish_ThrowsException(string? s, Type expectedExceptionType)
{
var usEnglish = CultureInfo.GetCultureInfo("en-US");
- Assert.Throws(expectedExceptionType, () => Length.Parse(s, usEnglish));
+ Assert.Throws(expectedExceptionType, () => Length.Parse(s!, usEnglish));
}
/// Error parsing string.
@@ -50,7 +50,7 @@ public void ParseLength_InvalidString_USEnglish_ThrowsException(string s, Type e
[InlineData("5.5 m", 5.5)]
[InlineData("500 005 m", 500005)]
// quantity doesn't match number format
- public void ParseWithCultureUsingSpaceAsThousandSeparators(string s, double expected)
+ public void ParseWithCultureUsingSpaceAsThousandSeparators(string? s, double expected)
{
var numberFormat = (NumberFormatInfo) CultureInfo.InvariantCulture.NumberFormat.Clone();
numberFormat.NumberGroupSeparator = " ";
@@ -58,7 +58,7 @@ public void ParseWithCultureUsingSpaceAsThousandSeparators(string s, double expe
numberFormat.NumberDecimalSeparator = ".";
numberFormat.CurrencyDecimalSeparator = ".";
- double actual = Length.Parse(s, numberFormat).Meters;
+ double actual = Length.Parse(s!, numberFormat).Meters;
Assert.Equal(expected, actual);
}
@@ -125,10 +125,10 @@ public void ParseLengthUnitUsEnglish(string s, LengthUnit expected)
[Theory]
[InlineData("kg", typeof(UnitNotFoundException))]
[InlineData(null, typeof(ArgumentNullException))]
- public void ParseLengthUnitUsEnglish_ThrowsExceptionOnInvalidString(string s, Type expectedExceptionType)
+ public void ParseLengthUnitUsEnglish_ThrowsExceptionOnInvalidString(string? s, Type expectedExceptionType)
{
var usEnglish = CultureInfo.GetCultureInfo("en-US");
- Assert.Throws(expectedExceptionType, () => Length.ParseUnit(s, usEnglish));
+ Assert.Throws(expectedExceptionType, () => Length.ParseUnit(s!, usEnglish));
}
[Theory]
@@ -137,7 +137,7 @@ public void ParseLengthUnitUsEnglish_ThrowsExceptionOnInvalidString(string s, Ty
[InlineData("2 kg", false)]
[InlineData(null, false)]
[InlineData("foo", false)]
- public void TryParseLengthUnitUsEnglish(string s, bool expected)
+ public void TryParseLengthUnitUsEnglish(string? s, bool expected)
{
CultureInfo usEnglish = CultureInfo.GetCultureInfo("en-US");
bool actual = Length.TryParse(s, usEnglish, out Length _);
diff --git a/UnitsNet.Tests/QuantityTests.cs b/UnitsNet.Tests/QuantityTests.cs
index 555153121c..7af958ab80 100644
--- a/UnitsNet.Tests/QuantityTests.cs
+++ b/UnitsNet.Tests/QuantityTests.cs
@@ -227,7 +227,7 @@ public void AllowSpecialValue()
}
catch (ArgumentException)
{
- Assert.True(false, "Special double values (NaN, -Inf, +Inf) must be allowed.");
+ Assert.Fail("Special double values (NaN, -Inf, +Inf) must be allowed.");
}
}
diff --git a/UnitsNet.Tests/UnitsNet.Tests.csproj b/UnitsNet.Tests/UnitsNet.Tests.csproj
index c863b2f552..fe4c5610ba 100644
--- a/UnitsNet.Tests/UnitsNet.Tests.csproj
+++ b/UnitsNet.Tests/UnitsNet.Tests.csproj
@@ -24,10 +24,10 @@
-
-
-
-
+
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/UnitsNet/UnitsNet.csproj b/UnitsNet/UnitsNet.csproj
index 8a350840ff..e8ac369fc4 100644
--- a/UnitsNet/UnitsNet.csproj
+++ b/UnitsNet/UnitsNet.csproj
@@ -50,7 +50,7 @@
-
+