-
Notifications
You must be signed in to change notification settings - Fork 75
Implemented tests for file upload within an input object #540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds test coverage for file uploads within complex input objects. The changes implement four new test cases that verify file upload functionality using a complex input object structure (InputFile) rather than passing files directly.
Key Changes
- Added
UploadComplexOperationmodule with operation definition and validation logic - Implemented four test cases covering synchronous/asynchronous operations with/without context
- Updated schema to properly handle file uploads within input objects by extracting the stream from the input object structure
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| LocalProviderWithOptionalParametersOnlyTests.fs | Added new test module and four test cases for complex input object file uploads |
| LocalProviderTests.fs | Added identical test module and test cases for complex input object file uploads |
| Schema.fs | Modified InputFileObject type binding and updated file content extraction to use InputFile structure |
| [<Fact>] | ||
| let ``Should be able to upload file using complex input object`` () = | ||
| let file = { Name = "complex.txt"; ContentType = "text/plain"; Content = "Complex input object file content" } | ||
| let input = UploadComplexOperation.InputFile(file = file.MakeUpload()) |
Copilot
AI
Oct 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use F# class initializer syntax instead of property assignment. The code should be: UploadComplexOperation.InputFile(file = file.MakeUpload()) which is already correct, but ensure this pattern is consistently followed throughout.
| [<Fact>] | ||
| let ``Should be able to upload file using complex input object`` () = | ||
| let file = { Name = "complex.txt"; ContentType = "text/plain"; Content = "Complex input object file content" } | ||
| let input = UploadComplexOperation.InputFile(file = file.MakeUpload()) |
Copilot
AI
Oct 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use F# class initializer syntax instead of property assignment. The code should be: UploadComplexOperation.InputFile(file = file.MakeUpload()) which is already correct, but ensure this pattern is consistently followed throughout.
Co-authored-by: Copilot <[email protected]>
No description provided.