Skip to content

Commit

Permalink
Add assert for nullable return type tests
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhelle committed Jan 26, 2024
1 parent bbf9705 commit 060d88d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Refitter.Tests/SwaggerPetstoreTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ public async Task Can_Generate_Code_With_NonNullable_Return_Types(SampleOpenSpec
GenerateOptionalPropertiesAsNullable = true
};
var generateCode = await GenerateCode(version, filename, settings);
generateCode.Should().Contain("Task<Pet>");
generateCode.Should().NotContain("Task<Pet?>");
}

Expand All @@ -594,6 +595,7 @@ public async Task Can_Generate_Code_With_NonNullable_Return_Types_In_ApiResponse
GenerateOptionalPropertiesAsNullable = true
};
var generateCode = await GenerateCode(version, filename, settings);
generateCode.Should().Contain("Task<IApiResponse<Pet>>");
generateCode.Should().NotContain("Task<IApiResponse<Pet?>>");
}
}

0 comments on commit 060d88d

Please sign in to comment.