diff --git a/csharp/test/Apache.Arrow.Tests/DurationArrayTests.cs b/csharp/test/Apache.Arrow.Tests/DurationArrayTests.cs index 0890d356b8e90..3395ca7bc9ad7 100644 --- a/csharp/test/Apache.Arrow.Tests/DurationArrayTests.cs +++ b/csharp/test/Apache.Arrow.Tests/DurationArrayTests.cs @@ -69,7 +69,11 @@ static TimeUnit RequiredPrecision(TimeSpan? timeSpan) { if (timeSpan == null) { return TimeUnit.Second; } if ((timeSpan.Value.Ticks % TicksPerMicrosecond) > 0) { return TimeUnit.Nanosecond; } +#if NET5_0_OR_GREATER if (timeSpan.Value.Microseconds > 0) { return TimeUnit.Microsecond; } +#else + if ((timeSpan.Value.Ticks % (TicksPerMicrosecond * 1000)) > 0) { return TimeUnit.Microsecond; } +#endif if (timeSpan.Value.Milliseconds > 0) { return TimeUnit.Millisecond; } return TimeUnit.Second; } diff --git a/csharp/test/Apache.Arrow.Tests/MapArrayTests.cs b/csharp/test/Apache.Arrow.Tests/MapArrayTests.cs index 034f120f3f016..7f35f104267dc 100644 --- a/csharp/test/Apache.Arrow.Tests/MapArrayTests.cs +++ b/csharp/test/Apache.Arrow.Tests/MapArrayTests.cs @@ -62,9 +62,9 @@ public void MapArray_Should_GetKeyValuePairs() var keyBuilder = builder.KeyBuilder as StringArray.Builder; var valueBuilder = builder.ValueBuilder as Int32Array.Builder; - KeyValuePair kv0 = KeyValuePair.Create("test", (int?)1); - KeyValuePair kv1 = KeyValuePair.Create("other", (int?)123); - KeyValuePair kv2 = KeyValuePair.Create("kv", (int?)null); + KeyValuePair kv0 = new KeyValuePair("test", (int?)1); + KeyValuePair kv1 = new KeyValuePair("other", (int?)123); + KeyValuePair kv2 = new KeyValuePair("kv", (int?)null); builder.Append(); keyBuilder.Append("test");