private static void VisitCosmosElementEnumerable(CosmosElement CosmosElement, IJsonWriter jsonWriter) { switch (CosmosElement.Type) { case CosmosElementType.String: LazyCosmosElementTests.VisitCosmosString(CosmosElement as CosmosString, jsonWriter); break; case CosmosElementType.Number: LazyCosmosElementTests.VisitCosmosNumber(CosmosElement as CosmosNumber, jsonWriter); break; case CosmosElementType.Object: LazyCosmosElementTests.VisitCosmosObjectEnumerable(CosmosElement as CosmosObject, jsonWriter); break; case CosmosElementType.Array: LazyCosmosElementTests.VisitCosmosArrayEnumerable(CosmosElement as CosmosArray, jsonWriter); break; case CosmosElementType.Boolean: LazyCosmosElementTests.VisitCosmosBoolean(CosmosElement as CosmosBoolean, jsonWriter); break; case CosmosElementType.Null: LazyCosmosElementTests.VisitCosmosNull(CosmosElement as CosmosNull, jsonWriter); break; default: throw new ArgumentException($"Unknown {nameof(CosmosElementType)}: {CosmosElement.Type}"); } }
private static void VisitCosmosElementEnumerable(CosmosElement cosmosElement, IJsonWriter jsonWriter) { switch (cosmosElement) { case CosmosString cosmosString: LazyCosmosElementTests.VisitCosmosString(cosmosString, jsonWriter); break; case CosmosNumber cosmosNumber: LazyCosmosElementTests.VisitCosmosNumber(cosmosNumber, jsonWriter); break; case CosmosObject cosmosObject: LazyCosmosElementTests.VisitCosmosObjectEnumerable(cosmosObject, jsonWriter); break; case CosmosArray cosmosArray: LazyCosmosElementTests.VisitCosmosArrayEnumerable(cosmosArray, jsonWriter); break; case CosmosBoolean cosmosBoolean: LazyCosmosElementTests.VisitCosmosBoolean(cosmosBoolean, jsonWriter); break; case CosmosNull cosmosNull: LazyCosmosElementTests.VisitCosmosNull(cosmosNull, jsonWriter); break; default: throw new NotImplementedException(); } }