Skip to content

Commit

Permalink
feat: Add test for standard schema
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccallum committed Aug 31, 2023
1 parent e526479 commit a6f49b3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/FairyBread.Tests/GeneralTests.SchemaWorks.verified.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
schema {
query: Query
mutation: Mutation
}

type Mutation {
write(foo: FooInputDtoInput! bar: BarInputDtoInput!): String!
}

type Query {
read(foo: FooInputDtoInput! bar: BarInputDtoInput): String!
readWithArrayArg(foos: [FooInputDtoInput!]!): String!
readWithListArg(foos: [FooInputDtoInput!]!): String!
someResolver(foo: FooInputDtoInput! bar: BarInputDtoInput): String!
intResolver(count: Int!): String!
nullableIntResolver(count: Int): String!
}

input BarInputDtoInput {
emailAddress: String!
}

input FooInputDtoInput {
someInteger: Int!
someString: String!
}
13 changes: 13 additions & 0 deletions src/FairyBread.Tests/GeneralTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ private static async Task<IRequestExecutor> GetRequestExecutorAsync(
.BuildRequestExecutorAsync();
}

[Fact]
public async Task SchemaWorks()
{
// Arrange
var executor = await GetRequestExecutorAsync();

// Act
var result = executor.Schema.ToString();

// Assert
await Verifier.Verify(result);
}

[Theory]
[MemberData(nameof(Cases))]
public async Task Query_Works(CaseData caseData)
Expand Down

0 comments on commit a6f49b3

Please sign in to comment.