From 2fb6c27893ab39d9f2b511f5bd1c6543d271b171 Mon Sep 17 00:00:00 2001 From: Nikolay Pianikov Date: Mon, 22 Jul 2024 18:17:56 +0300 Subject: [PATCH] Update Update README.md --- CSharpInteractive.Tests/README_TEMPLATE.md | 15 +++++++-------- .../UsageScenarios/BaseScenario.cs | 3 +-- .../UsageScenarios/PropsScenario.cs | 12 +++++------- README.md | 15 +++++++-------- 4 files changed, 20 insertions(+), 25 deletions(-) diff --git a/CSharpInteractive.Tests/README_TEMPLATE.md b/CSharpInteractive.Tests/README_TEMPLATE.md index c76d000f..f9fda957 100644 --- a/CSharpInteractive.Tests/README_TEMPLATE.md +++ b/CSharpInteractive.Tests/README_TEMPLATE.md @@ -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) @@ -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"; ``` diff --git a/CSharpInteractive.Tests/UsageScenarios/BaseScenario.cs b/CSharpInteractive.Tests/UsageScenarios/BaseScenario.cs index 367acd5a..c2aacaac 100644 --- a/CSharpInteractive.Tests/UsageScenarios/BaseScenario.cs +++ b/CSharpInteractive.Tests/UsageScenarios/BaseScenario.cs @@ -54,8 +54,7 @@ private class Properties : IProperties { private readonly Dictionary _dict = new() { - {"TEAMCITY_VERSION", "2021.2"}, - {"TEAMCITY_PROJECT_NAME", "Samples"} + {"version", "1.1.5"} }; public int Count => _dict.Count; diff --git a/CSharpInteractive.Tests/UsageScenarios/PropsScenario.cs b/CSharpInteractive.Tests/UsageScenarios/PropsScenario.cs index 02676ef8..bd3e3ac9 100644 --- a/CSharpInteractive.Tests/UsageScenarios/PropsScenario.cs +++ b/CSharpInteractive.Tests/UsageScenarios/PropsScenario.cs @@ -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"; // } } } \ No newline at end of file diff --git a/README.md b/README.md index 7f194fc5..2292decf 100644 --- a/README.md +++ b/README.md @@ -250,7 +250,7 @@ dotnet run --project Build - 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) @@ -312,17 +312,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"; ```