Skip to content

Commit 32fef78

Browse files
committed
Updating tests for new environment class
1 parent 1485fa1 commit 32fef78

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/ServiceManagement/Services/Commands.Test/Environment/AddAzureEnvironmentTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void AddsAzureEnvironment()
6262
cmdlet.ExecuteCmdlet();
6363
cmdlet.InvokeEndProcessing();
6464

65-
commandRuntimeMock.Verify(f => f.WriteObject(It.IsAny<PSObject>()), Times.Once());
65+
commandRuntimeMock.Verify(f => f.WriteObject(It.IsAny<PSAzureEnvironment>()), Times.Once());
6666
ProfileClient client = new ProfileClient(profile);
6767
AzureEnvironment env = client.GetEnvironmentOrDefault("KaTaL");
6868
Assert.Equal(env.Name, cmdlet.Name);
@@ -91,7 +91,7 @@ public void AddsEnvironmentWithMinimumInformation()
9191
cmdlet.ExecuteCmdlet();
9292
cmdlet.InvokeEndProcessing();
9393

94-
commandRuntimeMock.Verify(f => f.WriteObject(It.IsAny<PSObject>()), Times.Once());
94+
commandRuntimeMock.Verify(f => f.WriteObject(It.IsAny<PSAzureEnvironment>()), Times.Once());
9595
ProfileClient client = new ProfileClient(profile);
9696
AzureEnvironment env = client.Profile.Environments["KaTaL"];
9797
Assert.Equal(env.Name, cmdlet.Name);
@@ -146,9 +146,9 @@ public void AddsEnvironmentWithStorageEndpoint()
146146
{
147147
var profile = new AzureProfile();
148148
Mock<ICommandRuntime> commandRuntimeMock = new Mock<ICommandRuntime>();
149-
PSObject actual = null;
149+
PSAzureEnvironment actual = null;
150150
commandRuntimeMock.Setup(f => f.WriteObject(It.IsAny<object>()))
151-
.Callback((object output) => actual = (PSObject)output);
151+
.Callback((object output) => actual = (PSAzureEnvironment)output);
152152
AddAzureEnvironmentCommand cmdlet = new AddAzureEnvironmentCommand()
153153
{
154154
CommandRuntime = commandRuntimeMock.Object,
@@ -162,11 +162,11 @@ public void AddsEnvironmentWithStorageEndpoint()
162162
cmdlet.ExecuteCmdlet();
163163
cmdlet.InvokeEndProcessing();
164164

165-
commandRuntimeMock.Verify(f => f.WriteObject(It.IsAny<PSObject>()), Times.Once());
165+
commandRuntimeMock.Verify(f => f.WriteObject(It.IsAny<PSAzureEnvironment>()), Times.Once());
166166
ProfileClient client = new ProfileClient(profile);
167167
AzureEnvironment env = client.Profile.Environments["KaTaL"];
168168
Assert.Equal(env.Name, cmdlet.Name);
169-
Assert.Equal(env.Endpoints[AzureEnvironment.Endpoint.PublishSettingsFileUrl], actual.GetVariableValue<string>(AzureEnvironment.Endpoint.PublishSettingsFileUrl.ToString()));
169+
Assert.Equal(env.Endpoints[AzureEnvironment.Endpoint.PublishSettingsFileUrl], actual.PublishSettingsFileUrl);
170170
}
171171

172172
[Fact]

0 commit comments

Comments
 (0)