Beispiel #1
0
        public void SetWorkspace()
        {
            List <TrackingResult> trackingIds     = null;
            string EndUserFeedName                = "MockAwesomeFeed";
            SetAzureRemoteAppWorkspace mockCmdlet = SetUpTestCommon <SetAzureRemoteAppWorkspace>();

            // Required parameters for this test
            mockCmdlet.WorkspaceName = EndUserFeedName;

            // Setup the environment for testing this cmdlet
            MockObject.SetUpDefaultWorkspace(remoteAppManagementClientMock, ClientUrl, EndUserFeedName);
            MockObject.SetUpDefaultEditWorkspace(remoteAppManagementClientMock, EndUserFeedName);
            mockCmdlet.ResetPipelines();

            Log("Calling Set-AzureRemoteAppWorkspace");

            mockCmdlet.ExecuteCmdlet();
            if (mockCmdlet.runTime().ErrorStream.Count != 0)
            {
                Assert.True(false,
                            String.Format("Set-AzureRemoteAppWorkspace returned the following error {0}",
                                          mockCmdlet.runTime().ErrorStream[0].Exception.Message
                                          )
                            );
            }

            trackingIds = MockObject.ConvertList <TrackingResult>(mockCmdlet.runTime().OutputPipeline);
            Assert.NotNull(trackingId);

            Assert.True(MockObject.HasExpectedResults <TrackingResult>(trackingIds, MockObject.ContainsExpectedTrackingId),
                        "The actual result does not match the expected."
                        );

            Log("The test for Set-AzureRemoteAppWorkspace completed successfully");
        }