Skip to content

Commit 80d44a6

Browse files
author
jasper-schneider
committed
Merge remote-tracking branch 'upstream/dev' into gets
2 parents ad83ab8 + df9a0ce commit 80d44a6

File tree

133 files changed

+27945
-3922
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+27945
-3922
lines changed

AzurePowershell.Test.targets

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,35 @@
3232
<AzureRTSeqAllFilter>"AzureRTUpload|Sequential|Network"</AzureRTSeqAllFilter>
3333
</PropertyGroup>
3434

35+
<ItemGroup>
36+
<XUnitTests Include=".\src\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll"/>
37+
<XUnitTests Include=".\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll"/>
38+
<XUnitTests Include=".\src\ServiceManagement\Services\Commands.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Test.dll"/>
39+
<XUnitTests Include=".\src\ResourceManager\Resources\Commands.Resources.Test\bin\Debug\Microsoft.Azure.Commands.Resources.Test.dll"/>
40+
<XUnitTests Include=".\src\ResourceManager\DataFactories\Commands.DataFactories.Test\bin\Debug\Microsoft.Azure.Commands.DataFactories.Test.dll"/>
41+
<XUnitTests Include=".\src\ResourceManager\StreamAnalytics\Commands.StreamAnalytics.Test\bin\Debug\Microsoft.Azure.Commands.StreamAnalytics.Test.dll"/>
42+
<XUnitTests Include=".\src\ResourceManager\Batch\Commands.Batch.Test\bin\Debug\Microsoft.Azure.Commands.Batch.Test.dll"/>
43+
<XUnitTests Include=".\src\ResourceManager\KeyVault\Commands.KeyVault.Test\bin\Debug\Microsoft.Azure.Commands.KeyVault.Test.dll"/>
44+
<XUnitTests Include=".\src\ServiceManagement\ManagedCache\Commands.ManagedCache.Test\bin\Debug\Microsoft.Azure.Commands.ManagedCache.Test.dll"/>
45+
<XUnitTests Include=".\src\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll"/>
46+
<XUnitTests Include=".\src\ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Test.dll"/>
47+
<XUnitTests Include=".\src\ServiceManagement\StorSimple\Commands.StorSimple.Test\bin\Debug\Microsoft.WindowsAzure.Commands.StorSimple.Test.dll"/>
48+
</ItemGroup>
49+
3550
<Target Name="InvokeMSTest">
3651
<!--Remove existing test result; otherwsie mstest will error-->
3752
<Delete Files="$(_testResult)"/>
3853
<Exec
3954
Command="MSTest.exe /testcontainer:$(_testAssembly) /testsettings:$(_testSettings) /category:$(_testFilter) /resultsfile:$(_testResult)"
4055
ContinueOnError="false" />
4156
</Target>
57+
58+
<Target Name="InvokeXUnit">
59+
<Message Importance="high" Text="Running XUnit tests" />
60+
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
61+
<Xunit.Runner.MSBuild.xunit Assemblies="@(XUnitTests)" Html="$(TestOutputDirectory)\xunit.tests.dll.html" Verbose="true"
62+
ExcludeTraits="$(XUnitExcludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false"/>
63+
</Target>
4264

4365
<Target Name="BeforeRunTests">
4466
<Message Importance="high" Text="You are required to have installed a version of Visual Studio with support for MSTest (and MSTest on your path)." />

build.proj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<TestOutputDirectory>$(PublishDirectory)\TestResults</TestOutputDirectory>
1818
<DebugBuildConfig>Configuration=Debug;Platform=Any CPU</DebugBuildConfig>
1919
<ReleaseBuildConfig>Configuration=Release;Platform=Any CPU</ReleaseBuildConfig>
20+
<BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
2021
</PropertyGroup>
2122
<ItemGroup>
2223
<AzurePowerShellSln Include=".\src\AzurePowerShell.sln" />
@@ -104,11 +105,13 @@
104105
Projects="@(AzurePowerShellSln)"
105106
Targets="Build"
106107
Properties="$(DebugBuildConfig)"
108+
BuildInParallel="$(BuildInParallel)"
107109
ContinueOnError="false" />
108110
<MSBuild
109111
Projects="@(AzurePowerShellSln)"
110112
Targets="Build"
111113
Properties="$(ReleaseBuildConfig)"
114+
BuildInParallel="$(BuildInParallel)"
112115
ContinueOnError="false" />
113116
</Target>
114117

@@ -160,6 +163,7 @@
160163
Projects="@(AzurePowerShellSln)"
161164
Targets="Build"
162165
Properties="$(ReleaseBuildConfig)"
166+
BuildInParallel="$(BuildInParallel)"
163167
ContinueOnError="false" />
164168
</Target>
165169

@@ -170,6 +174,7 @@
170174
Projects="@(AzurePowerShellSln)"
171175
Targets="Build"
172176
Properties="$(DebugBuildConfig)"
177+
BuildInParallel="$(BuildInParallel)"
173178
ContinueOnError="false" />
174179
</Target>
175180

@@ -183,7 +188,7 @@
183188
<!-- Run checkin tests for each pull request -->
184189
<Target Name="Test" DependsOnTargets="BuildDebug;BeforeRunTests">
185190
<Message Importance="high" Text="Running check in tests..." />
186-
<CallTarget Targets="KeyVaultTests; SqlTests; CommonTests; TestManagement; TestHDInsight; TestManagedCache; TestServiceManagement; TestServiceManagementExtensions; TestSqlDatabase; TestStorage; TestResourceManager; MockedScenarioTests; TestDSCExtension_x64; TestBatch; TestDataFactoryManager; TestRecoveryServices; TestStreamAnalyticsManager; TestStorSimple"/>
191+
<CallTarget Targets="InvokeXUnit; TestHDInsight; TestServiceManagement; TestServiceManagementExtensions; TestSqlDatabase; TestStorage; TestDSCExtension_x64"/>
187192
</Target>
188193

189194
<!-- Run Full switch with scenario tests -->

setup/azurecmdfiles.wxi

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,15 +1527,24 @@
15271527
<Component Id="cmp8CDB44BA783FF24C94CDFC5D12066BB1" Guid="*">
15281528
<File Id="fil2C73256F76E79B695523A2B3C4C845E9" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.WindowsAzure.Commands.Common.dll" />
15291529
</Component>
1530-
<Component Id="cmpD7A9F76B2346156CA8F83F41A302B714" Guid="*">
1531-
<File Id="fil0218D7505353104A9DB742A55A839351" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.WindowsAzure.Management.dll" />
1530+
<Component Id="cmpA0A697DEB7822A0EC30F3D359EE930A6" Guid="*">
1531+
<File Id="fil528A48BB87B57E0D131C279CAD156D2B" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.WindowsAzure.Common.dll" />
1532+
</Component>
1533+
<Component Id="cmpBE209ED6509A7E857FD9F9078051DC6A" Guid="*">
1534+
<File Id="fil96FD7FA0CBEE96E0C0239408CD5651A9" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.WindowsAzure.Common.NetFramework.dll" />
15321535
</Component>
15331536
<Component Id="cmp4D3E383B38EF4392E70E981B7CA033D7" Guid="*">
15341537
<File Id="fil3D6B846AC421D38C5A9CB40A58B058B6" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.WindowsAzure.Management.SiteRecovery.dll" />
15351538
</Component>
1539+
<Component Id="cmp50D44814DFFEA762A53D9DEDCE48F689" Guid="*">
1540+
<File Id="fil80C14207B99E14F4567B92038EDC8715" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Microsoft.WindowsAzure.Management.Storage.dll" />
1541+
</Component>
15361542
<Component Id="cmp439E7C155DEEFC3877653E4ED11F66AC" Guid="*">
15371543
<File Id="filE3D7ECC5C92739687FAA34CCE9DFB4A3" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Newtonsoft.Json.dll" />
15381544
</Component>
1545+
<Component Id="cmp9B4CB06D327ECA8FA60032F98004D8BA" Guid="*">
1546+
<File Id="filC935CDA00FB3E840369825B599C84E28" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\Security.Cryptography.dll" />
1547+
</Component>
15391548
<Component Id="cmp5278A11908DC26651A78E55522C71DF3" Guid="*">
15401549
<File Id="fil3C9995984C13EAB542D813B85C917916" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\System.Net.Http.Extensions.dll" />
15411550
</Component>
@@ -1545,6 +1554,11 @@
15451554
<Component Id="cmp2A0B3E88742D800F88F70A714BAC94B5" Guid="*">
15461555
<File Id="fil8B5C2678B7FAC0061799DCBFF4AFE27E" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\System.Net.Http.Primitives.dll" />
15471556
</Component>
1557+
<Directory Id="dirB2E733E5A07F5CBD9FFA437A83782545" Name="lib">
1558+
<Component Id="cmpE3495C0DD75A31199E40EAA7E5128E6C" Guid="*">
1559+
<File Id="fil269C9C56525316A4AB13CC9240BF5FE6" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\RecoveryServices\lib\Security.Cryptography.dll" />
1560+
</Component>
1561+
</Directory>
15481562
</Directory>
15491563
<Directory Id="dir5A14F7172D6373ACE47493BAD054EEF3" Name="Services">
15501564
<Component Id="cmp5F55270F607737A772BFBE2D8F6B76E4" Guid="*">
@@ -2953,12 +2967,16 @@
29532967
<ComponentRef Id="cmpFFEE4D9645AEA846AF41897FD2135E02" />
29542968
<ComponentRef Id="cmp2F6E4C6B8006898EFE87C88921C1B6BA" />
29552969
<ComponentRef Id="cmp8CDB44BA783FF24C94CDFC5D12066BB1" />
2956-
<ComponentRef Id="cmpD7A9F76B2346156CA8F83F41A302B714" />
2970+
<ComponentRef Id="cmpA0A697DEB7822A0EC30F3D359EE930A6" />
2971+
<ComponentRef Id="cmpBE209ED6509A7E857FD9F9078051DC6A" />
29572972
<ComponentRef Id="cmp4D3E383B38EF4392E70E981B7CA033D7" />
2973+
<ComponentRef Id="cmp50D44814DFFEA762A53D9DEDCE48F689" />
29582974
<ComponentRef Id="cmp439E7C155DEEFC3877653E4ED11F66AC" />
2975+
<ComponentRef Id="cmp9B4CB06D327ECA8FA60032F98004D8BA" />
29592976
<ComponentRef Id="cmp5278A11908DC26651A78E55522C71DF3" />
29602977
<ComponentRef Id="cmp4ED39EDE761ED68263635882802FB1B5" />
29612978
<ComponentRef Id="cmp2A0B3E88742D800F88F70A714BAC94B5" />
2979+
<ComponentRef Id="cmpE3495C0DD75A31199E40EAA7E5128E6C" />
29622980
<ComponentRef Id="cmp5F55270F607737A772BFBE2D8F6B76E4" />
29632981
<ComponentRef Id="cmp9EF03D7C53CEE400751AD1905625B82B" />
29642982
<ComponentRef Id="cmpC4F524A9EBF63DAC78B9678CF113D652" />

src/AzurePowershell.sln

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 2013
3-
VisualStudioVersion = 12.0.30723.0
3+
VisualStudioVersion = 12.0.31101.0
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8531411A-0137-4E27-9C5E-49E07C245048}"
66
ProjectSection(SolutionItems) = preProject
@@ -163,6 +163,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Insights", "Resour
163163
EndProject
164164
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Insights.Test", "ResourceManager\Insights\Commands.Insights.Test\Commands.Insights.Test.csproj", "{469F20E0-9D40-41AD-94C3-B47AD15A4C00}"
165165
EndProject
166+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Websites", "ResourceManager\Websites\Commands.Websites\Commands.Websites.csproj", "{80A92297-7C92-456B-8EE7-9FB6CE30149D}"
167+
EndProject
166168
Global
167169
GlobalSection(SolutionConfigurationPlatforms) = preSolution
168170
Debug|Any CPU = Debug|Any CPU
@@ -397,6 +399,10 @@ Global
397399
{469F20E0-9D40-41AD-94C3-B47AD15A4C00}.Debug|Any CPU.Build.0 = Debug|Any CPU
398400
{469F20E0-9D40-41AD-94C3-B47AD15A4C00}.Release|Any CPU.ActiveCfg = Release|Any CPU
399401
{469F20E0-9D40-41AD-94C3-B47AD15A4C00}.Release|Any CPU.Build.0 = Release|Any CPU
402+
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
403+
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Debug|Any CPU.Build.0 = Debug|Any CPU
404+
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Release|Any CPU.ActiveCfg = Release|Any CPU
405+
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Release|Any CPU.Build.0 = Release|Any CPU
400406
EndGlobalSection
401407
GlobalSection(SolutionProperties) = preSolution
402408
HideSolutionNode = FALSE

src/Common/Commands.Common.Test/Common/ProfileCmdltsTests.cs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,50 @@ public void SelectAzureSubscriptionByNameUpdatesProfile()
517517
Assert.Equal(azureSubscription2.Id, cmdlt.Profile.Context.Subscription.Id);
518518
}
519519

520+
[Fact]
521+
public void SelectAzureSubscriptionByNameWithoutAccountPreservesTheAccount()
522+
{
523+
SetupDefaultProfile();
524+
SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
525+
526+
// Setup
527+
cmdlt.CommandRuntime = commandRuntimeMock;
528+
cmdlt.SetParameterSet("SelectSubscriptionByNameParameterSet");
529+
cmdlt.SubscriptionName = azureSubscription2.Name;
530+
531+
// Act
532+
cmdlt.InvokeBeginProcessing();
533+
cmdlt.ExecuteCmdlet();
534+
cmdlt.InvokeEndProcessing();
535+
536+
// Verify
537+
Assert.NotNull(cmdlt.Profile.Context.Subscription);
538+
Assert.Equal(azureSubscription2.Account, cmdlt.Profile.Context.Subscription.Account);
539+
Assert.Equal(azureSubscription2.Id, cmdlt.Profile.Context.Subscription.Id);
540+
}
541+
542+
[Fact]
543+
public void SelectAzureSubscriptionByIdWithoutAccountPreservesTheAccount()
544+
{
545+
SetupDefaultProfile();
546+
SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
547+
548+
// Setup
549+
cmdlt.CommandRuntime = commandRuntimeMock;
550+
cmdlt.SetParameterSet("SelectSubscriptionByIdParameterSet");
551+
cmdlt.SubscriptionId = azureSubscription2.Id.ToString();
552+
553+
// Act
554+
cmdlt.InvokeBeginProcessing();
555+
cmdlt.ExecuteCmdlet();
556+
cmdlt.InvokeEndProcessing();
557+
558+
// Verify
559+
Assert.NotNull(cmdlt.Profile.Context.Subscription);
560+
Assert.Equal(azureSubscription2.Account, cmdlt.Profile.Context.Subscription.Account);
561+
Assert.Equal(azureSubscription2.Id, cmdlt.Profile.Context.Subscription.Id);
562+
}
563+
520564
[Fact]
521565
public void SelectAzureSubscriptionWithoutPassthroughDoesNotPrint()
522566
{

src/Common/Commands.Common/Properties/Resources.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Common/Commands.Profile/Subscription/SelectAzureSubscription.cs

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System;
16+
using System.Linq;
1617
using System.Management.Automation;
1718
using Microsoft.WindowsAzure.Commands.Common;
1819
using Microsoft.Azure.Common.Authentication.Models;
@@ -94,20 +95,20 @@ public override void ExecuteCmdlet()
9495
switch (ParameterSetName)
9596
{
9697
case SelectSubscriptionByNameParameterSet:
97-
azureSubscription = ProfileClient.SetSubscriptionAsDefault(SubscriptionName, Account);
98+
azureSubscription = ProfileClient.SetSubscriptionAsDefault(SubscriptionName, GetAccount());
9899
break;
99100

100101
case SelectSubscriptionByIdParameterSet:
101-
azureSubscription = ProfileClient.SetSubscriptionAsDefault(SubscriptionIdAsGuid(), Account);
102+
azureSubscription = ProfileClient.SetSubscriptionAsDefault(SubscriptionIdAsGuid(), GetAccount());
102103
break;
103104

104105
case SelectDefaultSubscriptionByNameParameterSet:
105-
azureSubscription = ProfileClient.SetSubscriptionAsDefault(SubscriptionName, Account);
106+
azureSubscription = ProfileClient.SetSubscriptionAsDefault(SubscriptionName, GetAccount());
106107
WriteWarning("Current and Default parameters have been deprecated. Select-AzureSubscription will always update the Default Subscription.");
107108
break;
108109

109110
case SelectDefaultSubscriptionByIdParameterSet:
110-
azureSubscription = ProfileClient.SetSubscriptionAsDefault(SubscriptionIdAsGuid(), Account);
111+
azureSubscription = ProfileClient.SetSubscriptionAsDefault(SubscriptionIdAsGuid(), GetAccount());
111112
WriteWarning("Current and Default parameters have been deprecated. Select-AzureSubscription will always update the Default Subscription.");
112113
break;
113114

@@ -126,6 +127,31 @@ public override void ExecuteCmdlet()
126127
}
127128
}
128129

130+
/// <summary>
131+
/// Returns Account specified in the parameter or current account of the subscription
132+
/// </summary>
133+
/// <returns></returns>
134+
private string GetAccount()
135+
{
136+
if (!string.IsNullOrEmpty(Account))
137+
{
138+
return Account;
139+
}
140+
141+
AzureSubscription subscription = ProfileClient.Profile.Subscriptions.Values
142+
.FirstOrDefault(s => s.Name.Equals(SubscriptionName, StringComparison.InvariantCultureIgnoreCase) ||
143+
s.Id.ToString().Equals(SubscriptionId, StringComparison.InvariantCultureIgnoreCase));
144+
145+
if (subscription != null)
146+
{
147+
return subscription.Account;
148+
}
149+
else
150+
{
151+
return null;
152+
}
153+
}
154+
129155
private Guid SubscriptionIdAsGuid()
130156
{
131157
Guid subscriptionIdGuid;

src/ResourceManager/Insights/Commands.Insights.Test/Commands.Insights.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
5959
</Reference>
6060
<Reference Include="Microsoft.Azure.Insights">
61-
<HintPath>..\..\..\packages\Microsoft.Azure.Insights.0.7.0-preview\lib\net45\Microsoft.Azure.Insights.dll</HintPath>
61+
<HintPath>..\..\..\packages\Microsoft.Azure.Insights.0.7.1-preview\lib\net45\Microsoft.Azure.Insights.dll</HintPath>
6262
</Reference>
6363
<Reference Include="Microsoft.Azure.Test.Framework, Version=1.0.5513.27084, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6464
<SpecificVersion>False</SpecificVersion>

src/ResourceManager/Insights/Commands.Insights.Test/Events/Utilities.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,15 @@ public static void ExecuteVerifications(EventCmdletBase cmdlet, Mock<IEventOpera
214214
Assert.True(string.Equals(PSEventDataNoDetails.SelectedFieldsForQuery, selected, StringComparison.OrdinalIgnoreCase), "Incorrect selected clause without optional parameters");
215215

216216
// Calling with only start date
217-
cmdlet.StartTime = startDate.ToString("O");
217+
cmdlet.StartTime = startDate;
218218
cmdlet.ExecuteCmdlet();
219219

220220
VerifyFilterIsUsable(filter: filter);
221221
VerifyStartDateInFilter(filter: filter, startDate: startDate);
222222
VerifyConditionInFilter(filter: filter, field: requiredFieldName, value: requiredFieldValue);
223223

224224
// Calling with only start and end date
225-
cmdlet.EndTime = startDate.AddSeconds(2).ToString("O");
225+
cmdlet.EndTime = startDate.AddSeconds(2);
226226
cmdlet.ExecuteCmdlet();
227227

228228
VerifyFilterIsUsable(filter: filter);
@@ -245,6 +245,18 @@ public static void ExecuteVerifications(EventCmdletBase cmdlet, Mock<IEventOpera
245245

246246
VerifyDetailedOutput(cmdlet: cmdlet, selected: ref selected);
247247
VerifyContinuationToken(response: response, insinsightsEventOperationsMockightsClientMock: insinsightsEventOperationsMockightsClientMock, cmdlet: cmdlet);
248+
249+
// Execute negative tests
250+
cmdlet.StartTime = DateTime.Now.AddSeconds(1);
251+
Assert.Throws<ArgumentException>(() => cmdlet.ExecuteCmdlet());
252+
253+
cmdlet.StartTime = DateTime.Now.Subtract(TimeSpan.FromSeconds(20));
254+
cmdlet.EndTime = DateTime.Now.Subtract(TimeSpan.FromSeconds(21));
255+
Assert.Throws<ArgumentException>(() => cmdlet.ExecuteCmdlet());
256+
257+
cmdlet.StartTime = DateTime.Now.Subtract(TimeSpan.FromDays(30));
258+
cmdlet.EndTime = DateTime.Now.Subtract(TimeSpan.FromDays(14));
259+
Assert.Throws<ArgumentException>(() => cmdlet.ExecuteCmdlet());
248260
}
249261
}
250262
}

0 commit comments

Comments
 (0)