From 4628bef2839797fa16f3702c8ced6655a4af80b5 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 20 May 2020 10:29:43 +0300 Subject: Fixed test designer tooltips. Applied xml/pdb exclude/include through build events. ITestContext docs. --- .../FSE/Modules/Tango.FSE.Stubs/ITestContext.cs | 202 ++++++++++++++++++++- .../Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj | 3 + .../FSE/Modules/Tango.FSE.Stubs/TestContext.cs | 20 +- .../FSE/Tango.FSE.UI/Tango.FSE.UI.csproj | 9 + .../Tango.Scripting.Editors/Themes/Generic.xaml | 94 +--------- 5 files changed, 223 insertions(+), 105 deletions(-) (limited to 'Software/Visual_Studio') diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ITestContext.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ITestContext.cs index fc3344fa8..4546bd956 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ITestContext.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ITestContext.cs @@ -13,35 +13,225 @@ namespace Tango.FSE.Stubs { public interface ITestContext : IContext { + /// + /// Gets the list of current results. + /// ReadOnlyCollection Results { get; } + + /// + /// Adds a new test result. + /// + /// The result type. + /// The result name. + /// The result value. + /// Result AddResult(ResultType type, String name, object value); + + /// + /// Adds a new test result. + /// + /// The result. + /// Result AddResult(Result result); + + /// + /// Removes the specified test result. + /// + /// The result. void RemoveResult(Result result); + + /// + /// Clears all current test results. + /// void ClearResults(); - IMessage Run(String messageName, int? timeout = null, params Object[] args); - T Run(String messageName, int? timeout = null, params Object[] args) where T : class, IMessage; - IMessage Run(IMessage message, int? timeout = null); - T Run(IMessage message, int? timeout = null) where T : class, IMessage; - void RunContinuous(IMessage message, Action callback, int? timeout) where T : class, IMessage; - void RunContinuous(String messageName, Action callback, int? timeout, params Object[] args) where T : class, IMessage; + + /// + /// Sends a request by name with optional comma separated arguments. + /// + /// Name of the message. + /// The timeout. + /// The arguments separated by commas. + /// + IMessage Send(String messageName, int? timeout = null, params Object[] args); + + /// + /// Sends a request by name with optional comma separated arguments. + /// + /// + /// Name of the message. + /// The timeout. + /// The arguments separated by commas. + /// + T Send(String messageName, int? timeout = null, params Object[] args) where T : class, IMessage; + + /// + /// Sends the specified message. + /// + /// The message. + /// The timeout. + /// + IMessage Send(IMessage message, int? timeout = null); + + /// + /// Sends the specified message. + /// + /// + /// The message. + /// The timeout. + /// + T Send(IMessage message, int? timeout = null) where T : class, IMessage; + + /// + /// Sends the specified continuous message. + /// + /// + /// The message. + /// Callback for continuous responses. + /// The timeout. + void SendContinuous(IMessage message, Action callback, int? timeout) where T : class, IMessage; + + /// + /// Sends a continuous message with optional comma separated arguments. + /// + /// + /// Name of the message. + /// Callback for continuous responses. + /// The timeout. + /// The arguments. + void SendContinuous(String messageName, Action callback, int? timeout, params Object[] args) where T : class, IMessage; + + /// + /// Writes the specified object string representation to the output window. + /// + /// The object. void WriteLine(Object obj); + + /// + /// Writes the specified object string representation to the output window. + /// + /// The object. void Write(Object obj); + + /// + /// Writes the hexadecimal representation of the specified object to the output window. + /// + /// The number. + /// The digits. void WriteLineHex(Object number, int digits); + + /// + /// Writes the hexadecimal representation of the specified object to the output window. + /// + /// The number. + /// The digits. void WriteHex(Object number, int digits); + + /// + /// Writes the specified array to the output window using the specified parsing style. + /// + /// The array. + /// The style. void WriteLineArray(IEnumerable array, ArrayParsingStyle style); + + /// + /// Clears the output window. + /// void Clear(); + + /// + /// Writes a string content to the specified file. + /// If the file already exists it will be overwritten. + /// + /// The file path. + /// The content. void WriteToFile(String filePath, String content); + + /// + /// Appends the string content to the specified file. + /// + /// The file path. + /// The content. void AppendToFile(String filePath, String content); + + /// + /// Get the value of a user input by key. + /// + /// + /// The input key. + /// T GetInput(String key); + + /// + /// Gets the value of a user input as an array. + /// User input must be a comma separated string. + /// + /// + /// The input key. + /// List GetInputArray(String key); + + /// + /// Get the value of a user input by key. + /// + /// The input key. + /// Object GetInput(String key); + + /// + /// Fails the current test with the specified error message. + /// + /// The error message. void Fail(String message); + + /// + /// Displays an information message to the user. + /// + /// The message. void ShowInfo(String message); + + /// + /// Displays a warning message to the user. + /// + /// The message. void ShowWarning(String message); + + /// + /// Displays an error message to the user. + /// + /// The message. void ShowError(String message); + + /// + /// Present the user with a question an returns a value indicating the confirmation. + /// + /// The message. + /// bool ShowQuestion(String message); + + /// + /// Presents the user with a warning and returns a value indicating the confirmation. + /// + /// The message. + /// bool ShowWarningQuestion(String message); + + /// + /// Request a user input for the specified primitive or complex type. + /// + /// + /// The request title. + /// The request message. + /// T RequestUserInputFor(String title, String message); + + /// + /// Request a user input for the specified primitive or complex type (model). + /// + /// + /// The existing model. + /// The request title. + /// The request message. + /// T RequestUserInputFor(T model, String title, String message); } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj index 61dedf949..1fe35c2b1 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj @@ -24,6 +24,8 @@ DEBUG;TRACE prompt 4 + ..\..\..\Build\FSE\Debug\Tango.FSE.Stubs.xml + 1591 pdbonly @@ -32,6 +34,7 @@ TRACE prompt 4 + ..\..\..\Build\FSE\Release\Tango.FSE.Stubs.xml diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestContext.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestContext.cs index 9761a9378..7a71337bf 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestContext.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/TestContext.cs @@ -55,7 +55,7 @@ namespace Tango.FSE.Stubs TangoIOC.Default.Inject(this); } - public IMessage Run(string messageName, int? timeout = null, params object[] args) + public IMessage Send(string messageName, int? timeout = null, params object[] args) { var stubType = MessageFactory.GetAvailableRequestStubs().SingleOrDefault(x => x.Name.ToLower() == messageName.ToLower() || x.Name.Replace("Request", "").ToLower() == messageName.ToLower()); if (stubType == null) @@ -96,15 +96,15 @@ namespace Tango.FSE.Stubs } } - return Run(request as IMessage, timeout); + return Send(request as IMessage, timeout); } - public T Run(string messageName, int? timeout = null, params object[] args) where T : class, IMessage + public T Send(string messageName, int? timeout = null, params object[] args) where T : class, IMessage { - return Run(messageName, timeout, args) as T; + return Send(messageName, timeout, args) as T; } - public IMessage Run(IMessage message, int? timeout = null) + public IMessage Send(IMessage message, int? timeout = null) { TimeSpan? timespan = null; @@ -119,12 +119,12 @@ namespace Tango.FSE.Stubs }).Result; } - public T Run(IMessage messageName, int? timeout = null) where T : class, IMessage + public T Send(IMessage messageName, int? timeout = null) where T : class, IMessage { - return Run(messageName, timeout) as T; + return Send(messageName, timeout) as T; } - public void RunContinuous(IMessage messageName, Action callback, int? timeout = null) where T : class, IMessage + public void SendContinuous(IMessage messageName, Action callback, int? timeout = null) where T : class, IMessage { TaskCompletionSource completion = new TaskCompletionSource(); @@ -157,7 +157,7 @@ namespace Tango.FSE.Stubs completion.Task.GetAwaiter().GetResult(); } - public void RunContinuous(string messageName, Action callback, int? timeout = null, params object[] args) where T : class, IMessage + public void SendContinuous(string messageName, Action callback, int? timeout = null, params object[] args) where T : class, IMessage { var stubType = MessageFactory.GetAvailableRequestStubs().SingleOrDefault(x => x.Name.ToLower() == messageName.ToLower() || x.Name.Replace("Request", "").ToLower() == messageName.ToLower()); if (stubType == null) @@ -198,7 +198,7 @@ namespace Tango.FSE.Stubs } } - RunContinuous(request, callback as Action, timeout); + SendContinuous(request, callback as Action, timeout); } public void WriteLine(object obj) diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj index ec0629e99..429d82389 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj @@ -804,7 +804,16 @@ copy /Y "$(SolutionDir)Referenced Assemblies\vcruntime140.dll" "$(TargetDir)" copy /Y "$(SolutionDir)Referenced Assemblies\vcruntime140d.dll" "$(TargetDir)" copy /Y "$(SolutionDir)Referenced Assemblies\Microsoft.WITDataStore32.dll" "$(TargetDir)" +attrib +r Tango* +attrib +r Google.Protobuf.xml if $(ConfigurationName) == Release del *.xml +attrib -r Tango* +attrib -r Google.Protobuf.xml + +attrib +r Tango* +if $(ConfigurationName) == Release del *.pdb +attrib -r Tango* + if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)ProtoCompilers\" if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)Roslyn\" diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Themes/Generic.xaml b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Themes/Generic.xaml index 6455b8fcb..e8e5ffb91 100644 --- a/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Themes/Generic.xaml +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Themes/Generic.xaml @@ -54,6 +54,11 @@ + @@ -84,95 +89,6 @@ - - -- cgit v1.3.1