aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerghei Cebotari <serghei@cebotari.ru>2023-12-09 23:04:49 +0300
committerSerghei Cebotari <serghei@cebotari.ru>2023-12-09 23:04:49 +0300
commita8c192848de3cf6728326677cb047202366566c5 (patch)
treeba66d63563c0e87c9656737635ff8facfc43170d
parentf448cccbebaf9c6cc92f5576cb89e8918b1beec9 (diff)
Fixt testing environment variable
-rw-r--r--RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs20
-rw-r--r--RhSolutions.AddIn/Properties/launchSettings.json5
-rw-r--r--RhSolutions.Tests/.runsettings8
-rw-r--r--RhSolutions.Tests/CanDoGuess.cs1
-rw-r--r--RhSolutions.Tests/CanFillCouplings.cs1
-rw-r--r--RhSolutions.Tests/CanFillSleeves.cs1
-rw-r--r--RhSolutions.Tests/CanReadProducts.cs1
-rw-r--r--RhSolutions.Tests/CanWriteProducts.cs1
-rw-r--r--RhSolutions.Tests/RealPricelistTest.cs1
-rw-r--r--RhSolutions.Tests/WorkbookValidationTests.cs1
10 files changed, 15 insertions, 25 deletions
diff --git a/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs b/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs
index f2bdd6f..a5ff466 100644
--- a/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs
+++ b/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs
@@ -55,15 +55,9 @@ public sealed class RhSolutionsAddIn : IExcelAddIn
EventsUtil.Initialize();
- bool isTesting = Environment.GetEnvironmentVariable("ISTESTING") switch
+ if (Environment.GetEnvironmentVariable("ISTESTING") == "false")
{
- "true" => true,
- "false" => false,
- _ => false
- };
- if (!isTesting)
- {
- //IntelliSenseServer.Install();
+ IntelliSenseServer.Install();
}
ServicePointManager.SecurityProtocol =
@@ -74,15 +68,9 @@ public sealed class RhSolutionsAddIn : IExcelAddIn
{
EventsUtil.Uninitialize();
- bool isTesting = Environment.GetEnvironmentVariable("ISTESTING") switch
- {
- "true" => true,
- "false" => false,
- _ => false
- };
- if (!isTesting)
+ if (Environment.GetEnvironmentVariable("ISTESTING") == "false")
{
- //IntelliSenseServer.Uninstall();
+ IntelliSenseServer.Uninstall();
}
}
}
diff --git a/RhSolutions.AddIn/Properties/launchSettings.json b/RhSolutions.AddIn/Properties/launchSettings.json
index c36dbc3..7f7ccfe 100644
--- a/RhSolutions.AddIn/Properties/launchSettings.json
+++ b/RhSolutions.AddIn/Properties/launchSettings.json
@@ -3,7 +3,10 @@
"Excel": {
"commandName": "Executable",
"executablePath": "C:\\Program Files\\Microsoft Office\\root\\Office16\\EXCEL.EXE",
- "commandLineArgs": "RhSolutions-AddIn64.xll"
+ "commandLineArgs": "RhSolutions-AddIn64.xll",
+ "environmentVariables": {
+ "ISTESTING": "false"
+ }
}
}
} \ No newline at end of file
diff --git a/RhSolutions.Tests/.runsettings b/RhSolutions.Tests/.runsettings
deleted file mode 100644
index 5f93304..0000000
--- a/RhSolutions.Tests/.runsettings
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<RunSettings>
- <RunConfiguration>
- <EnvironmentVariables>
- <ISTESTING>true</ISTESTING>
- </EnvironmentVariables>
- </RunConfiguration>
-</RunSettings> \ No newline at end of file
diff --git a/RhSolutions.Tests/CanDoGuess.cs b/RhSolutions.Tests/CanDoGuess.cs
index a43c92e..c187a16 100644
--- a/RhSolutions.Tests/CanDoGuess.cs
+++ b/RhSolutions.Tests/CanDoGuess.cs
@@ -13,6 +13,7 @@ public class CanDoGuess : IDisposable
public CanDoGuess()
{
+ Environment.SetEnvironmentVariable("ISTESTING", "true");
_addIn = new();
_addIn.AutoOpen();
_guessReader = new GuessReader(Util.Application);
diff --git a/RhSolutions.Tests/CanFillCouplings.cs b/RhSolutions.Tests/CanFillCouplings.cs
index 48e4ee8..5a57c32 100644
--- a/RhSolutions.Tests/CanFillCouplings.cs
+++ b/RhSolutions.Tests/CanFillCouplings.cs
@@ -13,6 +13,7 @@ public class CanFillCouplings : IDisposable
public CanFillCouplings()
{
+ Environment.SetEnvironmentVariable("ISTESTING", "true");
_addIn = new();
_addIn.AutoOpen();
_calculator = new CouplingsCalculator();
diff --git a/RhSolutions.Tests/CanFillSleeves.cs b/RhSolutions.Tests/CanFillSleeves.cs
index ca00407..3b8adfa 100644
--- a/RhSolutions.Tests/CanFillSleeves.cs
+++ b/RhSolutions.Tests/CanFillSleeves.cs
@@ -13,6 +13,7 @@ public class CanFillSleeves : IDisposable
public CanFillSleeves()
{
+ Environment.SetEnvironmentVariable("ISTESTING", "true");
_addIn = new();
_addIn.AutoOpen();
_calculator = new SleevesCalculator();
diff --git a/RhSolutions.Tests/CanReadProducts.cs b/RhSolutions.Tests/CanReadProducts.cs
index e796da0..84de589 100644
--- a/RhSolutions.Tests/CanReadProducts.cs
+++ b/RhSolutions.Tests/CanReadProducts.cs
@@ -12,6 +12,7 @@ public class CanReadProducts : IDisposable
public CanReadProducts()
{
+ Environment.SetEnvironmentVariable("ISTESTING", "true");
_addIn = new();
_testWorkbook = Util.Application.Workbooks.Add();
_addIn.AutoOpen();
diff --git a/RhSolutions.Tests/CanWriteProducts.cs b/RhSolutions.Tests/CanWriteProducts.cs
index 50ce662..e6676cd 100644
--- a/RhSolutions.Tests/CanWriteProducts.cs
+++ b/RhSolutions.Tests/CanWriteProducts.cs
@@ -12,6 +12,7 @@ public class CanWriteProducts : IDisposable
public CanWriteProducts()
{
+ Environment.SetEnvironmentVariable("ISTESTING", "true");
_addIn = new();
_addIn.AutoOpen();
_reader = new ExcelReader(Util.Application, RhSolutionsAddIn.Configuration);
diff --git a/RhSolutions.Tests/RealPricelistTest.cs b/RhSolutions.Tests/RealPricelistTest.cs
index 9ff3a25..284c328 100644
--- a/RhSolutions.Tests/RealPricelistTest.cs
+++ b/RhSolutions.Tests/RealPricelistTest.cs
@@ -12,6 +12,7 @@ public class RealPricelistTest : IDisposable
public RealPricelistTest()
{
+ Environment.SetEnvironmentVariable("ISTESTING", "true");
_addIn = new();
_addIn.AutoOpen();
_reader = new ExcelReader(Util.Application, RhSolutionsAddIn.Configuration);
diff --git a/RhSolutions.Tests/WorkbookValidationTests.cs b/RhSolutions.Tests/WorkbookValidationTests.cs
index f5b338a..bd2af8c 100644
--- a/RhSolutions.Tests/WorkbookValidationTests.cs
+++ b/RhSolutions.Tests/WorkbookValidationTests.cs
@@ -10,6 +10,7 @@ public class WorkbookValidationTests : IDisposable
public WorkbookValidationTests()
{
+ Environment.SetEnvironmentVariable("ISTESTING", "true");
_addIn = new RhSolutionsAddIn();
_addIn.AutoOpen();
Util.Application.Workbooks.Add();