Skip to content
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

Enhancement: Add tests and API coverage documentation #15

Open
KristofferStrube opened this issue Jul 13, 2022 · 3 comments
Open

Enhancement: Add tests and API coverage documentation #15

KristofferStrube opened this issue Jul 13, 2022 · 3 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@KristofferStrube
Copy link
Owner

Why?

The wrapper is prone to human errors as it is an interpretation of the Web IDL specifications.
We have already seen such errors e.g. in PR #14. I originally didn't think that I needed to use unit tests for this project as the primary business logic was present in either the JS files or the actual browser API which would make it unsuitable for testing.

What?

What should we then test?
We have already seen that there can be some errors with the serialization because we create some of the objects used for serialization ourselves when objects have special inheritance relations. This should be tested.
We have also seen cases where we had missed special overloads of some methods from the original API. We should go through the Web IDL specifications systematically and ensure that representative methods/properties are present in the wrapper. This will also serve as an overview of which methods from the wrapper represent which methods in the underlying API which is currently not available without some exploration.

How?

  • We should test the serialization of option types using some unit testing framework.
  • We should ensure coverage of the API with documentation in the form of a table or diagram.
@KristofferStrube KristofferStrube added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 13, 2022
@KristofferStrube KristofferStrube changed the title Enhancement: Add tests Enhancement: Add tests and API coverage documentation Jul 13, 2022
@KristofferStrube
Copy link
Owner Author

The first steps towards getting an overview have been created by being able to take a diff between the current WebIDL spec and the spec that we have implemented. This enables us to see which parts we have implemented and enables us to discover changes to the WebIDL specs if they change.

https://kristofferstrube.github.io/Blazor.FileSystemAccess/Status

@KristofferStrube
Copy link
Owner Author

We should also add documentation in the form of XML summaries for all public properties and methods in the library.

@KristofferStrube
Copy link
Owner Author

Another reason to make that table that maps types/attributes from WebIDL to C# can be seen in release 1.2.0 where we found several naming errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant