private void getAndVerifyOrderProjections(Serialized client) { Debug.WriteLine("Getting single projections: " + ordersProjections); // Verify count var orderCount = client.GetSingleProjectionCount(ordersProjections); Assert.AreEqual(2, orderCount.Count); // Verify list var orders = client.ListSingleProjections(ordersProjections); Assert.AreEqual(false, orders.HasMore); Assert.AreEqual(2, orders.ProjectionsProperty.Count); // First var order = client.GetSingleProjection(ordersProjections, orderId1); Assert.AreEqual(orderId1, Guid.Parse(order.ProjectionId)); var projectionData = (JObject)order.Data; Assert.AreEqual(12345, projectionData["orderAmount"]); Assert.AreEqual("PAID", projectionData["status"]); // Second order = client.GetSingleProjection(ordersProjections, orderId2); Assert.AreEqual(orderId2, Guid.Parse(order.ProjectionId)); projectionData = (JObject)order.Data; Assert.AreEqual(67890, projectionData["orderAmount"]); Assert.AreEqual("PLACED", projectionData["status"]); }
private void filterOrderProjectionsByReference(Serialized client, string reference) { Debug.WriteLine("Filtering single projections by reference: " + ordersProjections); var orders = client.ListSingleProjections(ordersProjections, reference: reference); Assert.AreEqual(false, orders.HasMore); Assert.AreEqual(1, orders.ProjectionsProperty.Count); }