keen-sdk-net icon indicating copy to clipboard operation
keen-sdk-net copied to clipboard

Better validation for Datasets

Open masojus opened this issue 8 years ago • 2 comments
trafficstars

From review comments:

We should make sure these two names follow the rules for naming Cached Queries/Datasets: Names of Cached Datasets should be unique and can only contain alphanumeric characters, hypens ( - ), and underscores ( _ ) but the Display Name can be more human readable.

and

Both DatasetDefinition and QueryDefinition need more validation--e.g. timeframe must be relative, the timeframe units must match the interval, index_by cannot match a group_by property, etc.

masojus avatar Nov 04 '17 09:11 masojus

The unit tests for Datasets could also be augmented to check the actual structure of the URL or POST payload that is being sent, and also make sure that in success and error cases, the right values (if/when there can be ambiguity in how JSON.net deserializes) are in the response.

masojus avatar Nov 11 '17 04:11 masojus

Example from PR #128 :

"This test seems like it doesn't quite cover all validation. For example it doesn't really test that AnalysisType being unset will ever throw. Maybe separate tests for each invalid condition would be warranted? Maybe start with a valid dataset and then modify only one field at a time per-test and assert that it throws?"

masojus avatar Nov 11 '17 05:11 masojus