Fixt testing environment variable
This commit is contained in:
parent
f448cccbeb
commit
a8c192848d
@ -55,15 +55,9 @@ public sealed class RhSolutionsAddIn : IExcelAddIn
|
|||||||
|
|
||||||
EventsUtil.Initialize();
|
EventsUtil.Initialize();
|
||||||
|
|
||||||
bool isTesting = Environment.GetEnvironmentVariable("ISTESTING") switch
|
if (Environment.GetEnvironmentVariable("ISTESTING") == "false")
|
||||||
{
|
{
|
||||||
"true" => true,
|
IntelliSenseServer.Install();
|
||||||
"false" => false,
|
|
||||||
_ => false
|
|
||||||
};
|
|
||||||
if (!isTesting)
|
|
||||||
{
|
|
||||||
//IntelliSenseServer.Install();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ServicePointManager.SecurityProtocol =
|
ServicePointManager.SecurityProtocol =
|
||||||
@ -74,15 +68,9 @@ public sealed class RhSolutionsAddIn : IExcelAddIn
|
|||||||
{
|
{
|
||||||
EventsUtil.Uninitialize();
|
EventsUtil.Uninitialize();
|
||||||
|
|
||||||
bool isTesting = Environment.GetEnvironmentVariable("ISTESTING") switch
|
if (Environment.GetEnvironmentVariable("ISTESTING") == "false")
|
||||||
{
|
{
|
||||||
"true" => true,
|
IntelliSenseServer.Uninstall();
|
||||||
"false" => false,
|
|
||||||
_ => false
|
|
||||||
};
|
|
||||||
if (!isTesting)
|
|
||||||
{
|
|
||||||
//IntelliSenseServer.Uninstall();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,10 @@
|
|||||||
"Excel": {
|
"Excel": {
|
||||||
"commandName": "Executable",
|
"commandName": "Executable",
|
||||||
"executablePath": "C:\\Program Files\\Microsoft Office\\root\\Office16\\EXCEL.EXE",
|
"executablePath": "C:\\Program Files\\Microsoft Office\\root\\Office16\\EXCEL.EXE",
|
||||||
"commandLineArgs": "RhSolutions-AddIn64.xll"
|
"commandLineArgs": "RhSolutions-AddIn64.xll",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ISTESTING": "false"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<RunSettings>
|
|
||||||
<RunConfiguration>
|
|
||||||
<EnvironmentVariables>
|
|
||||||
<ISTESTING>true</ISTESTING>
|
|
||||||
</EnvironmentVariables>
|
|
||||||
</RunConfiguration>
|
|
||||||
</RunSettings>
|
|
@ -13,6 +13,7 @@ public class CanDoGuess : IDisposable
|
|||||||
|
|
||||||
public CanDoGuess()
|
public CanDoGuess()
|
||||||
{
|
{
|
||||||
|
Environment.SetEnvironmentVariable("ISTESTING", "true");
|
||||||
_addIn = new();
|
_addIn = new();
|
||||||
_addIn.AutoOpen();
|
_addIn.AutoOpen();
|
||||||
_guessReader = new GuessReader(Util.Application);
|
_guessReader = new GuessReader(Util.Application);
|
||||||
|
@ -13,6 +13,7 @@ public class CanFillCouplings : IDisposable
|
|||||||
|
|
||||||
public CanFillCouplings()
|
public CanFillCouplings()
|
||||||
{
|
{
|
||||||
|
Environment.SetEnvironmentVariable("ISTESTING", "true");
|
||||||
_addIn = new();
|
_addIn = new();
|
||||||
_addIn.AutoOpen();
|
_addIn.AutoOpen();
|
||||||
_calculator = new CouplingsCalculator();
|
_calculator = new CouplingsCalculator();
|
||||||
|
@ -13,6 +13,7 @@ public class CanFillSleeves : IDisposable
|
|||||||
|
|
||||||
public CanFillSleeves()
|
public CanFillSleeves()
|
||||||
{
|
{
|
||||||
|
Environment.SetEnvironmentVariable("ISTESTING", "true");
|
||||||
_addIn = new();
|
_addIn = new();
|
||||||
_addIn.AutoOpen();
|
_addIn.AutoOpen();
|
||||||
_calculator = new SleevesCalculator();
|
_calculator = new SleevesCalculator();
|
||||||
|
@ -12,6 +12,7 @@ public class CanReadProducts : IDisposable
|
|||||||
|
|
||||||
public CanReadProducts()
|
public CanReadProducts()
|
||||||
{
|
{
|
||||||
|
Environment.SetEnvironmentVariable("ISTESTING", "true");
|
||||||
_addIn = new();
|
_addIn = new();
|
||||||
_testWorkbook = Util.Application.Workbooks.Add();
|
_testWorkbook = Util.Application.Workbooks.Add();
|
||||||
_addIn.AutoOpen();
|
_addIn.AutoOpen();
|
||||||
|
@ -12,6 +12,7 @@ public class CanWriteProducts : IDisposable
|
|||||||
|
|
||||||
public CanWriteProducts()
|
public CanWriteProducts()
|
||||||
{
|
{
|
||||||
|
Environment.SetEnvironmentVariable("ISTESTING", "true");
|
||||||
_addIn = new();
|
_addIn = new();
|
||||||
_addIn.AutoOpen();
|
_addIn.AutoOpen();
|
||||||
_reader = new ExcelReader(Util.Application, RhSolutionsAddIn.Configuration);
|
_reader = new ExcelReader(Util.Application, RhSolutionsAddIn.Configuration);
|
||||||
|
@ -12,6 +12,7 @@ public class RealPricelistTest : IDisposable
|
|||||||
|
|
||||||
public RealPricelistTest()
|
public RealPricelistTest()
|
||||||
{
|
{
|
||||||
|
Environment.SetEnvironmentVariable("ISTESTING", "true");
|
||||||
_addIn = new();
|
_addIn = new();
|
||||||
_addIn.AutoOpen();
|
_addIn.AutoOpen();
|
||||||
_reader = new ExcelReader(Util.Application, RhSolutionsAddIn.Configuration);
|
_reader = new ExcelReader(Util.Application, RhSolutionsAddIn.Configuration);
|
||||||
|
@ -10,6 +10,7 @@ public class WorkbookValidationTests : IDisposable
|
|||||||
|
|
||||||
public WorkbookValidationTests()
|
public WorkbookValidationTests()
|
||||||
{
|
{
|
||||||
|
Environment.SetEnvironmentVariable("ISTESTING", "true");
|
||||||
_addIn = new RhSolutionsAddIn();
|
_addIn = new RhSolutionsAddIn();
|
||||||
_addIn.AutoOpen();
|
_addIn.AutoOpen();
|
||||||
Util.Application.Workbooks.Add();
|
Util.Application.Workbooks.Add();
|
||||||
|
Loading…
Reference in New Issue
Block a user