From 9fe5aa8c7643070959adac7a88c6614165ce4667 Mon Sep 17 00:00:00 2001 From: Koji Hasegawa Date: Mon, 21 Oct 2024 00:56:44 +0900 Subject: [PATCH 1/4] Add description into Reporters --- Editor/UI/Reporters/CompositeReporterEditor.cs | 13 +++++++++++-- Editor/UI/Reporters/SlackReporterEditor.cs | 13 ++++++++++++- Runtime/Reporters/AbstractReporter.cs | 9 ++++++++- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/Editor/UI/Reporters/CompositeReporterEditor.cs b/Editor/UI/Reporters/CompositeReporterEditor.cs index 0fe7f5f..5da1a5d 100644 --- a/Editor/UI/Reporters/CompositeReporterEditor.cs +++ b/Editor/UI/Reporters/CompositeReporterEditor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 DeNA Co., Ltd. +// Copyright (c) 2023-2024 DeNA Co., Ltd. // This software is released under the MIT License. using DeNA.Anjin.Reporters; @@ -14,6 +14,11 @@ namespace DeNA.Anjin.Editor.UI.Reporters [CustomEditor(typeof(CompositeReporter))] public class CompositeReporterEditor : UnityEditor.Editor { + private static readonly string s_description = L10n.Tr("Description"); + private static readonly string s_descriptionTooltip = L10n.Tr("Description about this logger instance"); + private SerializedProperty _descriptionProp; + private GUIContent _descriptionGUIContent; + private SerializedProperty _reportersProp; private ReorderableList _reorderableList; private static readonly string s_reporters = L10n.Tr("Reporters"); @@ -30,6 +35,9 @@ private void OnEnable() private void Initialize() { + _descriptionProp = serializedObject.FindProperty(nameof(SlackReporter.description)); + _descriptionGUIContent = new GUIContent(s_description, s_descriptionTooltip); + _reportersProp = serializedObject.FindProperty(nameof(CompositeReporter.reporters)); _reportersGUIContent = new GUIContent(s_reporters); _reporterGUIContent = new GUIContent(s_reporter); @@ -52,7 +60,8 @@ private void Initialize() public override void OnInspectorGUI() { serializedObject.Update(); - + + EditorGUILayout.PropertyField(_descriptionProp, _descriptionGUIContent); _reorderableList.DoLayoutList(); serializedObject.ApplyModifiedProperties(); diff --git a/Editor/UI/Reporters/SlackReporterEditor.cs b/Editor/UI/Reporters/SlackReporterEditor.cs index 292b382..e171670 100644 --- a/Editor/UI/Reporters/SlackReporterEditor.cs +++ b/Editor/UI/Reporters/SlackReporterEditor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 DeNA Co., Ltd. +// Copyright (c) 2023-2024 DeNA Co., Ltd. // This software is released under the MIT License. using DeNA.Anjin.Reporters; @@ -16,6 +16,11 @@ public class SlackReporterEditor : UnityEditor.Editor private const float SpacerPixels = 10f; private const float SpacerPixelsUnderHeader = 4f; + private static readonly string s_description = L10n.Tr("Description"); + private static readonly string s_descriptionTooltip = L10n.Tr("Description about this logger instance"); + private SerializedProperty _descriptionProp; + private GUIContent _descriptionGUIContent; + private static readonly string s_slackToken = L10n.Tr("Slack Token"); private static readonly string s_slackTokenTooltip = L10n.Tr("Slack API token"); private SerializedProperty _slackTokenProp; @@ -47,6 +52,9 @@ private void OnEnable() private void Initialize() { + _descriptionProp = serializedObject.FindProperty(nameof(SlackReporter.description)); + _descriptionGUIContent = new GUIContent(s_description, s_descriptionTooltip); + _slackTokenProp = serializedObject.FindProperty(nameof(SlackReporter.slackToken)); _slackTokenGUIContent = new GUIContent(s_slackToken, s_slackTokenTooltip); @@ -65,6 +73,9 @@ public override void OnInspectorGUI() { serializedObject.Update(); + EditorGUILayout.PropertyField(_descriptionProp, _descriptionGUIContent); + GUILayout.Space(SpacerPixels); + EditorGUILayout.PropertyField(_slackTokenProp, _slackTokenGUIContent); EditorGUILayout.PropertyField(_slackChannelsProp, _slackChannelsGUIContent); diff --git a/Runtime/Reporters/AbstractReporter.cs b/Runtime/Reporters/AbstractReporter.cs index 1fc1595..19e28b6 100644 --- a/Runtime/Reporters/AbstractReporter.cs +++ b/Runtime/Reporters/AbstractReporter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 DeNA Co., Ltd. +// Copyright (c) 2023-2024 DeNA Co., Ltd. // This software is released under the MIT License. using System.Threading; @@ -12,6 +12,13 @@ namespace DeNA.Anjin.Reporters /// public abstract class AbstractReporter : ScriptableObject { +#if UNITY_EDITOR + /// + /// Description about this agent instance. + /// + [Multiline] public string description; +#endif + /// /// Post report log message, stacktrace and screenshot /// From a7caa262061f38b73c1bc916e353d3961471705e Mon Sep 17 00:00:00 2001 From: Koji Hasegawa Date: Mon, 21 Oct 2024 01:04:05 +0900 Subject: [PATCH 2/4] Mod to hide obsolete fields on custom editor --- Editor/Localization/ja.po | 90 ++++++++++--------- Editor/UI/Settings/AutopilotSettingsEditor.cs | 28 +----- 2 files changed, 51 insertions(+), 67 deletions(-) diff --git a/Editor/Localization/ja.po b/Editor/Localization/ja.po index e39a2b0..42d16d6 100644 --- a/Editor/Localization/ja.po +++ b/Editor/Localization/ja.po @@ -103,46 +103,6 @@ msgstr "レポータ" msgid "Reporter that called when some errors occurred in target application" msgstr "対象のアプリケーションで発生したエラーを通知するレポータを指定します" -# obsolete slack settings -msgid "Slack settings will be moved to SlackReporter" -msgstr "Slack 設定は SlackReporter へ移動しました" - -# slackToken -msgid "Slack Token" -msgstr "Slackトークン" - -# slackToken tooltip -msgid "Slack API token" -msgstr "Slack通知に使用するWeb APIトークン(省略時は通知されない)" - -# slackChannels -msgid "Slack Channels" -msgstr "Slackチャンネル" - -# slackChannels tooltip -msgid "Slack channels to send notification" -msgstr "Slack通知を送るチャンネル(省略時は通知されない。現時点では1チャンネルのみ有効ですが、将来的にはカンマ区切りで複数指定対応予定)" - -# Header: Slack Mention Settings -msgid "Slack Mention Settings" -msgstr "Slackメンション設定" - -# mentionSubTeamIDs -msgid "Sub Team IDs to Mention" -msgstr "メンション宛先" - -# mentionSubTeamIDs tooltip -msgid "Sub team IDs to mention (comma separates)" -msgstr "Slack通知メッセージでメンションするチームのIDをカンマ区切りで指定します" - -# addHereInSlackMessage -msgid "Add @here Into Slack Message" -msgstr "@hereをメッセージにつける" - -# addHereInSlackMessage tooltip -msgid "Whether adding @here into Slack messages or not" -msgstr "Slack通知メッセージに@hereを付けます" - # Header: Error Handling Settings msgid "Error Handling Settings" msgstr "エラーハンドリング設定" @@ -489,3 +449,53 @@ msgstr "タイムスタンプを追加" # Timestamp tooltip msgid "Output timestamp to log entities" msgstr "ログエンティティにタイムスタンプを出力します" + + +#: Editor/UI/Reporters/ 共通 + +# description +msgid "Description" +msgstr "説明" + +# description tooltip +msgid "Description about this setting instance" +msgstr "このReporterインスタンスの説明" + + +#: Editor/UI/Reporters/SlackReporterEditor.cs + +# slackToken +msgid "Slack Token" +msgstr "Slackトークン" + +# slackToken tooltip +msgid "Slack API token" +msgstr "Slack通知に使用するWeb APIトークン(省略時は通知されない)" + +# slackChannels +msgid "Slack Channels" +msgstr "Slackチャンネル" + +# slackChannels tooltip +msgid "Slack channels to send notification" +msgstr "Slack通知を送るチャンネル(省略時は通知されない。現時点では1チャンネルのみ有効ですが、将来的にはカンマ区切りで複数指定対応予定)" + +# Header: Slack Mention Settings +msgid "Slack Mention Settings" +msgstr "Slackメンション設定" + +# mentionSubTeamIDs +msgid "Sub Team IDs to Mention" +msgstr "メンション宛先" + +# mentionSubTeamIDs tooltip +msgid "Sub team IDs to mention (comma separates)" +msgstr "Slack通知メッセージでメンションするチームのIDをカンマ区切りで指定します" + +# addHereInSlackMessage +msgid "Add @here Into Slack Message" +msgstr "@hereをメッセージにつける" + +# addHereInSlackMessage tooltip +msgid "Whether adding @here into Slack messages or not" +msgstr "Slack通知メッセージに@hereを付けます" diff --git a/Editor/UI/Settings/AutopilotSettingsEditor.cs b/Editor/UI/Settings/AutopilotSettingsEditor.cs index b71d6fb..0b3d1a7 100644 --- a/Editor/UI/Settings/AutopilotSettingsEditor.cs +++ b/Editor/UI/Settings/AutopilotSettingsEditor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 DeNA Co., Ltd. +// Copyright (c) 2023-2024 DeNA Co., Ltd. // This software is released under the MIT License. using System.Diagnostics.CodeAnalysis; @@ -49,17 +49,6 @@ public class AutopilotSettingsEditor : UnityEditor.Editor private static readonly string s_reporter = L10n.Tr("Reporter"); private static readonly string s_reporterTooltip = L10n.Tr("Reporter that called when some errors occurred in target application"); - private static readonly string s_slackToken = L10n.Tr("Slack Token"); - private static readonly string s_slackTokenTooltip = L10n.Tr("Slack API token"); - private static readonly string s_slackChannels = L10n.Tr("Slack Channels"); - private static readonly string s_slackChannelsTooltip = L10n.Tr("Slack channels to send notification"); - - private static readonly string s_slackMentionSettingsHeader = L10n.Tr("Slack Mention Settings"); - private static readonly string s_mentionSubTeamIDs = L10n.Tr("Sub Team IDs to Mention"); - private static readonly string s_mentionSubTeamIDsTooltip = L10n.Tr("Sub team IDs to mention (comma separates)"); - private static readonly string s_addHereInSlackMessage = L10n.Tr("Add @here Into Slack Message"); - private static readonly string s_addHereInSlackMessageTooltip = L10n.Tr("Whether adding @here into Slack messages or not"); - private static readonly string s_errorHandlingSettingsHeader = L10n.Tr("Error Handling Settings"); private static readonly string s_handleException = L10n.Tr("Handle Exception"); private static readonly string s_handleExceptionTooltip = L10n.Tr("Notify when Exception detected in log"); @@ -71,9 +60,6 @@ public class AutopilotSettingsEditor : UnityEditor.Editor private static readonly string s_handleWarningTooltip = L10n.Tr("Notify when Warning detected in log"); private static readonly string s_ignoreMessages = L10n.Tr("Ignore Messages"); - private static readonly string s_obsoletedSlackParamsHelpBox = - L10n.Tr("Slack settings will be moved to SlackReporter"); - private static readonly string s_ignoreMessagesTooltip = L10n.Tr("Do not send notifications when log messages contain this string"); @@ -119,18 +105,6 @@ public override void OnInspectorGUI() new GUIContent(s_logger, s_loggerTooltip)); EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(AutopilotSettings.reporter)), new GUIContent(s_reporter, s_reporterTooltip)); - EditorGUILayout.HelpBox(s_obsoletedSlackParamsHelpBox, MessageType.Warning); - EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(AutopilotSettings.slackToken)), - new GUIContent(s_slackToken, s_slackTokenTooltip)); - EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(AutopilotSettings.slackChannels)), - new GUIContent(s_slackChannels, s_slackChannelsTooltip)); - - DrawHeader(s_slackMentionSettingsHeader); - EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(AutopilotSettings.mentionSubTeamIDs)), - new GUIContent(s_mentionSubTeamIDs, s_mentionSubTeamIDsTooltip)); - EditorGUILayout.PropertyField( - serializedObject.FindProperty(nameof(AutopilotSettings.addHereInSlackMessage)), - new GUIContent(s_addHereInSlackMessage, s_addHereInSlackMessageTooltip)); DrawHeader(s_errorHandlingSettingsHeader); EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(AutopilotSettings.handleException)), From 6ae5f164940d3a746a5a36fb8a5eed11259a07e2 Mon Sep 17 00:00:00 2001 From: Koji Hasegawa Date: Mon, 21 Oct 2024 01:48:20 +0900 Subject: [PATCH 3/4] Add convert temporarily SlackReporter when has old Slack settings --- README.md | 20 +++++++++-- README_ja.md | 21 ++++++++++-- Runtime/Autopilot.cs | 25 ++++++++++++++ Runtime/Settings/AutopilotSettings.cs | 10 ------ Tests/Runtime/AutopilotTest.cs | 48 +++++++++++++++++++++++++++ 5 files changed, 110 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 3bde51f..ca10b40 100644 --- a/README.md +++ b/README.md @@ -291,7 +291,7 @@ Therefore, please be careful to record in units of Scenes. A screenshot of the operation by Automated QA is stored under `Application.persistentDataPath/Anjin`. The `Application.persistentDataPath` for each platform can be found in the Unity manual at -[Application.persistentDataPath](https://docs.unity3d.com/ScriptReference/Application-persistentDataPath.html). +[Scripting API: Application.persistentDataPath](https://docs.unity3d.com/ScriptReference/Application-persistentDataPath.html). ### DoNothingAgent @@ -541,7 +541,7 @@ Open it in the inspector and click the **Reset** button. If this does not solve the problem, try deleting `AutopilotState.asset`. -### [CompilerError] Argument 1: Cannot convert to 'System.Threading.CancellationToken' +### \[CompilerError\] Argument 1: Cannot convert to 'System.Threading.CancellationToken' The following compilation error has been reported in some cases: @@ -560,6 +560,22 @@ Find out why you have an old UniTask installed. e.g., Check the contents of Packages/packages-lock.json generated by the Unity editor; use your IDE's code definition jump function to check where the source file of `UniTask.WaitForEndOfFrame()` is. +### Warning message "settings has been obsoleted" when running autopilot + +For example, the following warning message may be output log. + +``` +Slack settings in AutopilotSettings has been obsoleted. +Please delete the value using Debug Mode in the Inspector window. And create a SlackReporter asset file. +``` + +Even if you have already migrated to a new setting method (`SlackReporter` in the above example), you are warned that values remain in obsolete fields. +You can edit obsolete fields by opening the settings file in the Inspector window and switching to Debug Mode. + +For information on how to use the Inspector window, see the Unity manual: +[Manual: Working in the Inspector](https://docs.unity3d.com/Manual/InspectorOptions.html) + + ## License diff --git a/README_ja.md b/README_ja.md index 7dc8422..ca9d61f 100644 --- a/README_ja.md +++ b/README_ja.md @@ -294,7 +294,7 @@ Automated QAによる操作のレコーディングは、Unityエディターの また、Automated QAによる操作のスクリーンショットを`Application.persistentDataPath/Anjin`下に保存しています。 各プラットフォームの`Application.persistentDataPath`はUnityマニュアルの -[Application.persistentDataPath](https://docs.unity3d.com/ScriptReference/Application-persistentDataPath.html) +[Scripting API: Application.persistentDataPath](https://docs.unity3d.com/ScriptReference/Application-persistentDataPath.html) を参照してください。 @@ -544,7 +544,7 @@ Anjinの実行状態を永続化している `AutopilotState.asset` が不正な それでも解決しない場合、 `AutopilotState.asset` を削除してみてください。 -### [CompilerError] Argument 1: Cannot convert to 'System.Threading.CancellationToken' +### \[CompilerError\] Argument 1: Cannot convert to 'System.Threading.CancellationToken' 次のコンパイルエラーが発生するケースが報告されています。 @@ -562,6 +562,23 @@ Compiler Error at Library\PackageCache\com.dena.anjin@1.0.1\Runtime\Reporters\Sl Unityエディターが生成するPackages/packages-lock.jsonの中身を確認するか、お使いのIDEのコード定義ジャンプ機能で `UniTask.WaitForEndOfFrame()` のソースファイルがどこにあるかを確認するなどして、古いUniTaskがインストールされている原因を突き止められます。 +### 実行中に "settings has been obsoleted" 警告が出る + +たとえば次のような警告メッセージが出力されることがあります。 + +``` +Slack settings in AutopilotSettings has been obsoleted. +Please delete the value using Debug Mode in the Inspector window. And create a SlackReporter asset file. +``` + +すでに新しい設定方法(上例では `SlackReporter` )に移行済みであっても、廃止されたフィールドに値が残っていることを警告されています。 +設定ファイルをInspectorウィンドウで開き、**Debug Mode** に切り替えることで廃止されたフィールドを編集できます。 + +Inspectorウィンドウの操作については、Unityマニュアルの +[Inspector の使用 - Unity マニュアル](https://docs.unity3d.com/ja/current/Manual/InspectorOptions.html) +を参照してください。 + + ## ライセンス diff --git a/Runtime/Autopilot.cs b/Runtime/Autopilot.cs index d9c0ece..657deb8 100644 --- a/Runtime/Autopilot.cs +++ b/Runtime/Autopilot.cs @@ -6,6 +6,7 @@ using System.Threading; using Cysharp.Threading.Tasks; using DeNA.Anjin.Loggers; +using DeNA.Anjin.Reporters; using DeNA.Anjin.Settings; using DeNA.Anjin.Utilities; using UnityEngine; @@ -37,6 +38,8 @@ private void Start() _loggerAsset = _settings.loggerAsset; _logger = _loggerAsset != null ? _loggerAsset.Logger : CreateDefaultLogger(); + ConvertSlackReporterFromObsoleteSlackSettings(_settings, _logger); + if (!int.TryParse(_settings.randomSeed, out var seed)) { seed = Environment.TickCount; @@ -77,6 +80,28 @@ private static ILogger CreateDefaultLogger() return Debug.unityLogger; } + [Obsolete("Remove this method when bump major version")] + internal static void ConvertSlackReporterFromObsoleteSlackSettings(AutopilotSettings settings, ILogger logger) + { + if (string.IsNullOrEmpty(settings.slackToken) || string.IsNullOrEmpty(settings.slackChannels) || + settings.reporter != null) + // TODO: This condition will change when the AutopilotSettings.reporter is changed to a List. + { + return; + } + + logger.Log(LogType.Warning, @"Slack settings in AutopilotSettings has been obsoleted. +Please delete the value using Debug Mode in the Inspector window. And create a SlackReporter asset file. +This time, temporarily generate and use SlackReporter instance."); + + var reporter = ScriptableObject.CreateInstance(); + reporter.slackToken = settings.slackToken; + reporter.slackChannels = settings.slackChannels; + reporter.mentionSubTeamIDs = settings.mentionSubTeamIDs; + reporter.addHereInSlackMessage = settings.addHereInSlackMessage; + settings.reporter = reporter; + } + /// /// Terminate when ran specified time. /// diff --git a/Runtime/Settings/AutopilotSettings.cs b/Runtime/Settings/AutopilotSettings.cs index 84c3287..ef959a6 100644 --- a/Runtime/Settings/AutopilotSettings.cs +++ b/Runtime/Settings/AutopilotSettings.cs @@ -180,16 +180,6 @@ public void OverrideByCommandLineArguments(Arguments args) { handleWarning = args.HandleWarning.Value(); } - - if (args.SlackToken.IsCaptured()) - { - slackToken = args.SlackToken.Value(); - } - - if (args.SlackChannels.IsCaptured()) - { - slackChannels = args.SlackChannels.Value(); - } } } } diff --git a/Tests/Runtime/AutopilotTest.cs b/Tests/Runtime/AutopilotTest.cs index cd87fa0..4958c70 100644 --- a/Tests/Runtime/AutopilotTest.cs +++ b/Tests/Runtime/AutopilotTest.cs @@ -1,8 +1,11 @@ // Copyright (c) 2023-2024 DeNA Co., Ltd. // This software is released under the MIT License. +using System; using System.Collections.Generic; +using System.Text.RegularExpressions; using System.Threading.Tasks; +using DeNA.Anjin.Reporters; using DeNA.Anjin.Settings; using DeNA.Anjin.TestDoubles; using NUnit.Framework; @@ -40,5 +43,50 @@ public async Task Start_LoggerSpecified_UsingSpecifiedLogger() Assert.That(spyLogger.Logs, Does.Contain("Launched autopilot")); // using spy logger LogAssert.NoUnexpectedReceived(); // not write to console } + + [Test] + public void ConvertSlackReporterFromObsoleteSlackSettings_HasSlackSettings_GenerateSlackReporter() + { + var settings = ScriptableObject.CreateInstance(); + settings.slackToken = "token"; + settings.slackChannels = "channels"; + settings.mentionSubTeamIDs = "subteam"; + settings.addHereInSlackMessage = true; + + Autopilot.ConvertSlackReporterFromObsoleteSlackSettings(settings, Debug.unityLogger); + + var slackReporter = settings.reporter as SlackReporter; + Assert.That(slackReporter, Is.Not.Null); + Assert.That(slackReporter.slackToken, Is.EqualTo(settings.slackToken)); + Assert.That(slackReporter.slackChannels, Is.EqualTo(settings.slackChannels)); + Assert.That(slackReporter.mentionSubTeamIDs, Is.EqualTo(settings.mentionSubTeamIDs)); + Assert.That(slackReporter.addHereInSlackMessage, Is.EqualTo(settings.addHereInSlackMessage)); + + LogAssert.Expect(LogType.Warning, @"Slack settings in AutopilotSettings has been obsoleted. +Please delete the value using Debug Mode in the Inspector window. And create a SlackReporter asset file. +This time, temporarily generate and use SlackReporter instance."); + } + + [Test] + public void ConvertSlackReporterFromObsoleteSlackSettings_HasNotSlackSettings_NotGenerateSlackReporter() + { + var settings = ScriptableObject.CreateInstance(); + settings.slackToken = "token"; + + Autopilot.ConvertSlackReporterFromObsoleteSlackSettings(settings, Debug.unityLogger); + Assert.That(settings.reporter, Is.Null); + } + + [Test] + public void ConvertSlackReporterFromObsoleteSlackSettings_HasSlackReporter_NotGenerateSlackReporter() + { + var settings = ScriptableObject.CreateInstance(); + settings.reporter = ScriptableObject.CreateInstance(); + settings.slackToken = "token"; + settings.slackChannels = "channels"; + + Autopilot.ConvertSlackReporterFromObsoleteSlackSettings(settings, Debug.unityLogger); + Assert.That(settings.reporter, Is.InstanceOf()); + } } } From 8ab6fcd402d5b4d8e452a5fd471dae5b80ec5919 Mon Sep 17 00:00:00 2001 From: Koji Hasegawa Date: Mon, 21 Oct 2024 03:04:31 +0900 Subject: [PATCH 4/4] Fix tests --- Tests/Runtime/Settings/AutopilotSettingsTest.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Tests/Runtime/Settings/AutopilotSettingsTest.cs b/Tests/Runtime/Settings/AutopilotSettingsTest.cs index 2c6a25f..e200714 100644 --- a/Tests/Runtime/Settings/AutopilotSettingsTest.cs +++ b/Tests/Runtime/Settings/AutopilotSettingsTest.cs @@ -20,8 +20,6 @@ private static AutopilotSettings CreateAutopilotSettings() sut.handleError = true; sut.handleAssert = true; sut.handleWarning = true; - sut.slackToken = "token"; - sut.slackChannels = "channel1, channel2, channel3"; return sut; } @@ -37,8 +35,6 @@ private static Arguments CreateNotCapturedArguments() _handleError = new StubArgument(), // Not captured _handleAssert = new StubArgument(), // Not captured _handleWarning = new StubArgument(), // Not captured - _slackToken = new StubArgument(), // Not captured - _slackChannels = new StubArgument(), // Not captured }; return arguments; } @@ -57,8 +53,6 @@ public void OverrideByCommandLineArguments_HasNotCommandlineArguments_KeepScript Assert.That(sut.handleError, Is.True); Assert.That(sut.handleAssert, Is.True); Assert.That(sut.handleWarning, Is.True); - Assert.That(sut.slackToken, Is.EqualTo("token")); - Assert.That(sut.slackChannels, Is.EqualTo("channel1, channel2, channel3")); } private static Arguments CreateCapturedArguments() @@ -73,8 +67,6 @@ private static Arguments CreateCapturedArguments() _handleError = new StubArgument(true, false), _handleAssert = new StubArgument(true, false), _handleWarning = new StubArgument(true, false), - _slackToken = new StubArgument(true, "another token"), - _slackChannels = new StubArgument(true, "channel4"), }; return arguments; } @@ -93,8 +85,6 @@ public void OverrideByCommandLineArguments_HasCommandlineArguments_OverwriteValu Assert.That(sut.handleError, Is.False); Assert.That(sut.handleAssert, Is.False); Assert.That(sut.handleWarning, Is.False); - Assert.That(sut.slackToken, Is.EqualTo("another token")); - Assert.That(sut.slackChannels, Is.EqualTo("channel4")); } } }