Skip to content

Commit ec2bc5c

Browse files
fix test
1 parent 4dcb053 commit ec2bc5c

File tree

9 files changed

+16
-26
lines changed

9 files changed

+16
-26
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
These are the changes to each version that has been released in the Visual Studio Marketplace.
44

5+
## 1.1.43
6+
**2017-07-20**
7+
- [x] Addition of Open In Atom
8+
59
## 1.1.41
6-
**2017-07-15**
10+
**2017-07-16**
711
- [x] Addition of 'Open In ...' when folder node selected for all appropriate applications
812
- [x] Addition of 'Open In ...' when project node selected for all appropriate applications
913
- [x] Exclusion of \bin and \obj directories when 'Open In ...' project node selected

src/OpenInApp.Command/InvokeCommandCallBackDto.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ public class InvokeCommandCallBackDto
1919
public bool SuppressTypicalFileExtensionsWarning { get; set; }
2020
public string TypicalFileExtensions { get; set; }
2121
public bool UseShellExecute { get; set; }
22-
public bool WrapArgumentsWithQuotations { get; set; }
2322
}
2423
}

src/OpenInApp.Command/MenuItemCallBackHelper.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ public PersistOptionsDto InvokeCommandCallBack(InvokeCommandCallBackDto dto)
106106
dto.SeparateProcessPerFileToBeOpened,
107107
dto.UseShellExecute,
108108
dto.ArtefactTypeToOpen,
109-
dto.ProcessWithinProcess,
110-
dto.WrapArgumentsWithQuotations);
109+
dto.ProcessWithinProcess);
111110
}
112111
}
113112
}

src/OpenInApp.Common.Tests/Helpers/GeneralOptionsHelperTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class GeneralOptionsHelperTests
1414

1515
[Test()]
1616
[TestCase(KeyToExecutableEnum.AltovaXMLSpy, @"C:\Program Files (x86)\Altova\XMLSpy2016\XMLSpy.exe")]
17-
[TestCase(KeyToExecutableEnum.Atom, @"C:\Users\gtrev\AppData\Local\atom\atom.exe")]
17+
[TestCase(KeyToExecutableEnum.Atom, OverrideAtTestExecutionTime)]
1818
[TestCase(KeyToExecutableEnum.ChromeCanary, OverrideAtTestExecutionTime)]
1919
//[TestCase(KeyToExecutableEnum.Emacs, null)]
2020
[TestCase(KeyToExecutableEnum.FirefoxDeveloperEdition, @"C:\Program Files\Firefox Developer Edition\firefox.exe")]
@@ -46,6 +46,9 @@ public void GetActualPathToExeTest(KeyToExecutableEnum keyToExecutableEnum, stri
4646

4747
switch (keyToExecutableEnum)
4848
{
49+
case KeyToExecutableEnum.Atom:
50+
expected = Path.Combine(localApplicationData, @"atom\bin\atom.cmd");
51+
break;
4952
case KeyToExecutableEnum.ChromeCanary:
5053
expected = Path.Combine(localApplicationData, @"Google\Chrome SxS\Application\chrome.exe");
5154
break;

src/OpenInApp.Common.Tests/Helpers/OpenInAppHelperTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ private void InvokeApplication(KeyToExecutableEnum keyToExecutableEnum, string e
150150
artefactsToBeOpened = GetTestArtefactsToBeOpened(singleOrMultipleArtefacts, typ, dto, artefactsToBeOpened);
151151

152152
// Act
153-
OpenInAppHelper.InvokeCommand(artefactsToBeOpened, executableFullPath, dto.SeparateProcessPerFileToBeOpened, dto.UseShellExecute, dto.ArtefactTypeToOpen, dto.ProcessWithinProcess, dto.WrapArgumentsWithQuotations);
153+
OpenInAppHelper.InvokeCommand(artefactsToBeOpened, executableFullPath, dto.SeparateProcessPerFileToBeOpened, dto.UseShellExecute, dto.ArtefactTypeToOpen, dto.ProcessWithinProcess);
154154
}
155155

156156
private string executableFullPath { get; set; }

src/OpenInApp.Common/Helpers/ApplicationToOpenHelper.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public ApplicationToOpenDto GetApplicationToOpenDto(KeyToExecutableEnum keyToExe
4444
SecondaryFilePathSegmentHasMultipleVersions = false,
4545
SeparateProcessPerFileToBeOpened = true,
4646
UseShellExecute = true,
47-
WrapArgumentsWithQuotations = true,
4847
};
4948

5049
switch (keyToExecutableEnum)
@@ -142,7 +141,6 @@ public ApplicationToOpenDto GetApplicationToOpenDto(KeyToExecutableEnum keyToExe
142141
applicationToOpenDto.SecondaryFilePathSegment = @"atom\bin";
143142
applicationToOpenDto.SeparateProcessPerFileToBeOpened = false;
144143
applicationToOpenDto.UseShellExecute = false;
145-
//gregtt applicationToOpenDto.WrapArgumentsWithQuotations = false;
146144
break;
147145
case KeyToExecutableEnum.ChromeCanary:
148146
applicationToOpenDto.SecondaryFilePathSegment = @"Google\Chrome SxS\Application";

src/OpenInApp.Common/Helpers/Dtos/ApplicationToOpenDto.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ public class ApplicationToOpenDto
1414
public bool SecondaryFilePathSegmentHasMultipleVersions { get; set; }
1515
public bool SeparateProcessPerFileToBeOpened { get; set; }
1616
public bool UseShellExecute { get; set; }
17-
public bool WrapArgumentsWithQuotations { get; set; }//gregtt delete this
1817
}
1918
}

src/OpenInApp.Common/Helpers/OpenInAppHelper.cs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ public static void InvokeCommand(
1616
bool separateProcessPerFileToBeOpened,
1717
bool useShellExecute,//gregtt rename to OpenExeWithinItsWorkingDirectory
1818
ArtefactTypeToOpen artefactTypeToOpen,
19-
bool processWithinProcess,
20-
bool wrapArgumentsWithQuotations)
19+
bool processWithinProcess)
2120
{
2221
string fileName;
2322
string workingDirectory = string.Empty;
@@ -36,7 +35,7 @@ public static void InvokeCommand(
3635
{
3736
foreach (var actualArtefactToBeOpened in actualArtefactsToBeOpened)
3837
{
39-
var argument = GetSingleArgument(actualArtefactToBeOpened, wrapArgumentsWithQuotations);
38+
var argument = GetSingleArgument(actualArtefactToBeOpened);
4039
InvokeProcess(argument, fileName, useShellExecute, workingDirectory, processWithinProcess);
4140
}
4241
}
@@ -46,7 +45,7 @@ public static void InvokeCommand(
4645

4746
foreach (var actualArtefactToBeOpened in actualArtefactsToBeOpened)
4847
{
49-
arguments += GetSingleArgument(actualArtefactToBeOpened, wrapArgumentsWithQuotations);
48+
arguments += GetSingleArgument(actualArtefactToBeOpened);
5049
}
5150

5251
arguments = arguments.TrimEnd(' ');
@@ -55,19 +54,9 @@ public static void InvokeCommand(
5554
}
5655
}
5756

58-
private static string GetSingleArgument(string argument, bool wrapArgumentsWithQuotations)
57+
private static string GetSingleArgument(string argument)
5958
{
60-
string result;
61-
62-
if (wrapArgumentsWithQuotations)
63-
{
64-
result = "\"" + argument + "\"";
65-
}
66-
else
67-
{
68-
result = argument;
69-
}
70-
59+
var result = "\"" + argument + "\"";
7160
return result + " ";
7261
}
7362

src/OpenInApp.Menu/MenuCore.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ private InvokeCommandCallBackDto GetInvokeCommandCallBackDto(
227227
SuppressTypicalFileExtensionsWarning = suppressTypicalFileExtensionsWarning,
228228
TypicalFileExtensions = typicalFileExtensions,
229229
UseShellExecute = applicationToOpenDto.UseShellExecute,
230-
WrapArgumentsWithQuotations = applicationToOpenDto.WrapArgumentsWithQuotations,
231230
};
232231
}
233232
}

0 commit comments

Comments
 (0)