Skip to content

Commit 2f25662

Browse files
committed
Add test for missing values in aggregate interface
Add test with partial payload for aggregate interface validation Signed-off-by: Osman Hadzic <[email protected]>
1 parent b82352c commit 2f25662

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

AstarteDeviceSDKCSharp.Tests/Protocol/AstarteDeviceAggregateDatastreamInterfaceTest.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,19 @@ public void ValidateAggregateWithBadArraysTest()
177177
Assert.Throws<AstarteInvalidValueException>(() =>
178178
aInterfaceWArray.ValidatePayload("/test", payload, new DateTime()));
179179
}
180+
181+
[Fact]
182+
public void ValidateAggregateWithMissingValueTest()
183+
{
184+
Dictionary<string, object> payload = new Dictionary<string, object>();
185+
payload.Add("int", 1);
186+
payload.Add("intArray", new int[] { 1, 2, -4 });
187+
188+
var exception = Record.Exception(() =>
189+
aInterfaceWArray.ValidatePayload("/test", payload, new DateTime()));
190+
191+
Assert.Null(exception);
192+
}
193+
180194
}
181195
}

0 commit comments

Comments
 (0)