public void TupleTypes() { var expected = @"[ number, [ boolean ], string ]"; var type = new Schema(BifoqlType.Tuple(BifoqlType.Number, BifoqlType.Tuple(BifoqlType.Boolean), BifoqlType.String)); Assert.Equal(expected, type.BuildDocumentation()); }
public void MapTypes() { var expected = @"{ x: number, burger: [ boolean ], street: string }"; var type = new Schema(BifoqlType.Map( BifoqlType.Property("x", BifoqlType.Number), BifoqlType.Property("burger", BifoqlType.Tuple(BifoqlType.Boolean)), BifoqlType.Property("street", BifoqlType.String))); Assert.Equal(expected, type.BuildDocumentation()); }
public void MapTypesWithDocumentation() { var expected = @"{ // A number x: number, // A tasty burger // yum! burger: [ boolean ], // The street street: string }"; var type = new Schema(BifoqlType.Map( BifoqlType.Property("x", BifoqlType.Number, "A number"), BifoqlType.Property("burger", BifoqlType.Tuple(BifoqlType.Boolean), "A tasty burger\nyum!"), BifoqlType.Property("street", BifoqlType.String, "The street"))); Assert.Equal(expected, type.BuildDocumentation()); }