{"id":17008711,"url":"https://github.com/i-e-b/dynamicvalidation","last_synced_at":"2025-03-22T12:29:10.931Z","repository":{"id":4894275,"uuid":"6049846","full_name":"i-e-b/DynamicValidation","owner":"i-e-b","description":"Object-Tree validation tools","archived":false,"fork":false,"pushed_at":"2013-11-01T12:51:51.000Z","size":571,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-28T07:14:28.432Z","etag":null,"topics":["assert","c-sharp","predicates","testing-tools","tree-validation","validation"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"coreos/elb-presence","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/i-e-b.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-02T19:04:08.000Z","updated_at":"2018-07-20T09:34:25.000Z","dependencies_parsed_at":"2022-09-15T02:51:47.764Z","dependency_job_id":null,"html_url":"https://github.com/i-e-b/DynamicValidation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FDynamicValidation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FDynamicValidation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FDynamicValidation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FDynamicValidation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i-e-b","download_url":"https://codeload.github.com/i-e-b/DynamicValidation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244958778,"owners_count":20538620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assert","c-sharp","predicates","testing-tools","tree-validation","validation"],"created_at":"2024-10-14T05:29:04.399Z","updated_at":"2025-03-22T12:29:10.908Z","avatar_url":"https://github.com/i-e-b.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"DynamicValidation\n=================\n\nObject-Tree validation tools.\n\nExperiments in the direction of simple and readable validation of the\nstructure and data of any object tree.\n\nValidation assertions can be either INamedPredicates or NUnit assertion\nconstraints.\n\nTodo\n----\n* Maybe handle recursive data structures by having another List assertion strategy (\"all,recurse\"?)\n  will assert on matching level, and any children with same name.\n  (this would allow for `group-\u003egroup-\u003egroup...-\u003eitem`)\n\nExample\n-------\n\n```\nCheck.Result result = Check.That(MyObject).Identifier.LocalIdentifier[Should.NotBeNull];\n\nif ( ! result.Success) throw new Exception(result.Reason);\n```\n\nThe idea is to get the check object, walk the object tree\nthen pass a set of validation predicates into the index.\n\nThen get a result back, success or failure, with a message\nfor failure which is the name of the predicates that failed.\n\nIf any part of the object tree is null except the last item\nthen that's a failure with it's own message.\n\nTo check each item in an enumerable, you can use\n```\nvar result = Check.That(subject).container(\"all\")[Should.NotBeNull)];\n```\n\nIf the validation needs to check children of an enumerable\ncan define like this:\n```\n    Check.That(thing).a.b[Should.HaveAtLeast(1)]\n    Check.That(thing).a.b(\"all\").c[Should.NotBeEmpty]\n    Check.That(thing).a.b(\"first\").c.d[Should.NotBeEmpty]\n    Check.That(thing).a.b(\"single\").c.d[Should.NotBeEmpty]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-e-b%2Fdynamicvalidation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi-e-b%2Fdynamicvalidation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-e-b%2Fdynamicvalidation/lists"}