Skip to content

Commit

Permalink
Update Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Jul 22, 2024
1 parent 17ad49a commit f696dc7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
15 changes: 7 additions & 8 deletions CSharpInteractive.Tests/README_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

- Global state
- [Using Args](#using-args)
- [Using Props dictionary](#using-props-dictionary)
- [Using Props](#using-props)
- [Using the Host property](#using-the-host-property)
- [Get services](#get-services)
- [Service collection](#service-collection)
Expand Down Expand Up @@ -65,17 +65,16 @@ if (Args.Count > 1)



### Using Props dictionary
### Using Props


Properties _Props_ have got from TeamCity system properties automatically.

``` CSharp
WriteLine(Props["TEAMCITY_VERSION"]);
WriteLine(Props["TEAMCITY_PROJECT_NAME"]);
WriteLine(Props["version"]);

// This property will be available at the next TeamCity steps as system parameter _system.Version_
// and some runners, for instance, the .NET runner, pass it as a build property.
Props["Version"] = "1.1.6";
// Some CI/CDs have integration of these properties.
// For example in TeamCity this property with all changes will be available in the next TeamCity steps.
Props["version"] = "1.1.6";
```


Expand Down
3 changes: 1 addition & 2 deletions CSharpInteractive.Tests/UsageScenarios/BaseScenario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ private class Properties : IProperties
{
private readonly Dictionary<string, string> _dict = new()
{
{"TEAMCITY_VERSION", "2021.2"},
{"TEAMCITY_PROJECT_NAME", "Samples"}
{"version", "1.1.5"}
};

public int Count => _dict.Count;
Expand Down
12 changes: 5 additions & 7 deletions CSharpInteractive.Tests/UsageScenarios/PropsScenario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ public void Run()
// $visible=true
// $tag=08 Global state
// $priority=01
// $description=Using Props dictionary
// $header=Properties _Props_ have got from TeamCity system properties automatically.
// $description=Using Props
// {
WriteLine(Props["TEAMCITY_VERSION"]);
WriteLine(Props["TEAMCITY_PROJECT_NAME"]);
WriteLine(Props["version"]);

// This property will be available at the next TeamCity steps as system parameter _system.Version_
// and some runners, for instance, the .NET runner, pass it as a build property.
Props["Version"] = "1.1.6";
// Some CI/CDs have integration of these properties.
// For example in TeamCity this property with all changes will be available in the next TeamCity steps.
Props["version"] = "1.1.6";
// }
}
}

0 comments on commit f696dc7

Please sign in to comment.