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
54 changes: 54 additions & 0 deletions MEOS.NET.Tests/CountedArrayTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using MEOS.NET.Enums;
using MEOS.NET.Types;

namespace MEOS.NET.Tests
{
/// <summary>
/// MEOS reads an array of its own values through a pointer to the first
/// element and a count, so a method taking one takes a C# array and answers
/// its length to MEOS.
/// </summary>
[TestClass]
public class CountedArrayTests : MeosTest
{
[TestMethod]
public void ASequenceIsMadeOfItsInstants()
{
Temporal[] instants =
[
TFloat.In("25.0@2024-12-06")!,
TFloat.In("27.0@2024-12-07")!,
TFloat.In("30.0@2024-12-09")!,
];

Temporal sequence = TSequence.Make(instants, true, true, InterpType.Linear, true)!;

Assert.AreEqual(3, sequence.NumInstants());
Assert.AreEqual(
"[25@2024-12-06 00:00:00+00, 27@2024-12-07 00:00:00+00, 30@2024-12-09 00:00:00+00]",
sequence.ToString());
}

[TestMethod]
public void MergingAnArrayOfTemporalValuesJoinsThem()
{
Temporal[] parts =
[
TFloat.In("[25.0@2024-12-06, 27.0@2024-12-07]")!,
TFloat.In("[30.0@2024-12-09, 32.0@2024-12-10]")!,
];

Temporal merged = Temporal.MergeArray(parts)!;

Assert.AreEqual(4, merged.NumInstants());
Assert.AreEqual(2, merged.NumSequences());
}

[TestMethod]
public void AnEmptyArrayIsARequestMeosRefuses()
{
Assert.ThrowsException<MEOS.NET.Exceptions.MEOSInvalidArgValueException>(
() => TSequence.Make([], true, true, InterpType.Linear, true));
}
}
}
2 changes: 2 additions & 0 deletions MEOS.NET/Types/BigIntSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/BigIntSpan.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/BigIntSpanSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/Box.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/CbufferSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/Collection.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/DateSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/DateSpan.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/DateSpanSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/FloatSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/FloatSpan.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/FloatSpanSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/GeogSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/GeomSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/IntSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/IntSpan.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/IntSpanSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/NpointSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/PoseSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/STBox.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/Set.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/Span.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/SpanSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TAlpha.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TBigint.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TBigintInst.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TBigintSeq.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TBigintSeqSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TBool.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TBoolInst.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TBoolSeq.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TBoolSeqSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TBox.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TCbuffer.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TCbufferInst.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TCbufferSeq.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TCbufferSeqSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TFloat.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TFloatInst.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TFloatSeq.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TFloatSeqSet.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TGeo.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
2 changes: 2 additions & 0 deletions MEOS.NET/Types/TGeogPoint.g.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#nullable enable

using System.Runtime.InteropServices;

using MEOS.NET.Enums;
using MEOS.NET.Functions;

Expand Down
Loading
Loading