Behaviour SwRS-MDOKFSTUDIO-REVIEW-065
A comment carries the configured, Git or system author name
When the host stores a comment or a reply, the extension SHALL use as author the comments.authorName setting, else the Git user.name of the document repository, else the operating system user name, else Anonymous, with control characters replaced by spaces and the name trimmed and cut at 100 characters.
Another outcome at step 5 of path 1 in StRS-MDOKFSTUDIO-REVIEW-003, in the state “The comment has its anchor”.
Scenarios 6
The situations the tests check; open one to read it.
nominalSetting wins
Giventhe setting authorName set to Ada Reviewer and a Git user.name of Bob
Whena comment is saved
Thenthe author is Ada Reviewer
boundaryOrder of the sources
| Input | Outcome |
|---|---|
| The setting is set | The author is the setting |
| The setting is empty and the Git user.name is Bob | The author is Bob |
| The setting and the Git name are empty and the operating system user name is known | The author is the operating system user name |
| An empty setting, no Git name and no system user name | The author is Anonymous |
boundaryThe name is cleaned and cut
| Input | Outcome |
|---|---|
| An author name holding a tab or a line break | Each control character becomes a space and the ends are trimmed |
| A name of 150 characters | The name is cut at 100 characters |
nominalThe Git user name is read through the built-in Git extension
Givena repository whose user.name is " Ada "
Whenthe host needs the Git user name of the document
Thenthe name is Ada
refusalNo Git user name
Givenno Git extension, no repository, no getConfig or an empty value
Whenthe host reads the Git user name
Thenno name is returned and the next source is used
boundaryThe comments.authorName setting
| Input | Outcome |
|---|---|
| The setting is set to Ada Reviewer | The author name is Ada Reviewer |
| The setting is set to a number | The author name is the empty default |
| The setting as declared by the extension | It is in the Comments category with type string, default empty and resource scope |
| The setting is set in a workspace folder | The folder value is read for the documents of that folder, over the user value |