Refactoring

This commit is contained in:
Sergey Chebotar 2023-05-17 08:03:55 +03:00
parent e203155474
commit 9f0ef90005

View File

@ -41,8 +41,8 @@ public sealed class RhSolutionsAddIn : IExcelAddIn
Excel = ServiceProvider.GetService<Application>(); Excel = ServiceProvider.GetService<Application>();
EventsUtil.Initialize(); EventsUtil.Initialize();
string variable = Environment.GetEnvironmentVariable("ISTESTING");
bool isTesting = variable switch bool isTesting = Environment.GetEnvironmentVariable("ISTESTING") switch
{ {
"true" => true, "true" => true,
"false" => false, "false" => false,
@ -59,7 +59,9 @@ public sealed class RhSolutionsAddIn : IExcelAddIn
public void AutoClose() public void AutoClose()
{ {
EventsUtil.Uninitialize(); bool isTesting = Environment.GetEnvironmentVariable("ISTESTING") switch EventsUtil.Uninitialize();
bool isTesting = Environment.GetEnvironmentVariable("ISTESTING") switch
{ {
"true" => true, "true" => true,
"false" => false, "false" => false,