Skip to content

Add ability to generate field values. #7

@dsolovay

Description

@dsolovay

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions