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

Add ability to generate field values. #7

Open
dsolovay opened this issue Sep 17, 2016 · 0 comments
Open

Add ability to generate field values. #7

dsolovay opened this issue Sep 17, 2016 · 0 comments

Comments

@dsolovay
Copy link
Owner

It might be useful to be able to specify field keys, names, and values, like this:

[Theory, AutoSitecore]
public void GetFields([FieldData(id:"dc6f8e14-629e-43b8-bf59-527f0328648f", name:"Title", value:"Welcome")][FieldData(id:"c9b44403-be9e-4fd8-8531-5743ea81ef4c", name: "Body", value:"<p>This is text.</p>")]Item item)
{
   item["Title"].Should().Be("Welcome");
   item["Body"].Should().Be("<p>This is text.</p>");
}

Key points:

  • You can string multiple FieldData attributes together.
  • If FieldData is present, then use this and not the ItemData fields value (e.g. don't create anonymous field values)
  • If Id, Name, or Value are not specified, create anonymous values for the missing parameters.
  • Eventually, this should be usable outside of a parameter, in the main body of the test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant