/// <summary> /// Asserts that we get the right output even after reversing the order of input. /// </summary> private void AssertExpandObjectValid(OrderPreservingDictionary <FieldPath, Value> input, Dictionary <string, Value> expected) { var actual = WriteBatch.ExpandObject(input); Assert.Equal(expected, actual); actual = WriteBatch.ExpandObject(input.InReverseOrder()); Assert.Equal(expected, actual); }
/// <summary> /// Asserts that expanding the given input fails in both the original order and reverse order. /// </summary> private void AssertExpandObjectInvalid(OrderPreservingDictionary <FieldPath, Value> input) { Assert.Throws <InvalidOperationException>(() => WriteBatch.ExpandObject(input)); Assert.Throws <InvalidOperationException>(() => WriteBatch.ExpandObject(input.InReverseOrder())); }