/// <summary>
        ///  C'tor for AddIntuneiOSMAMPolicyAppCmdletTests class.
        /// </summary>
        public AddIntuneiOSMAMPolicyAppCmdletTests()
        {
            commandRuntimeMock = new Mock<ICommandRuntime>();
            intuneClientMock = new Mock<IIntuneResourceManagementClient>();

            cmdlet = new AddIntuneiOSMAMPolicyAppCmdlet();
            this.cmdlet.CommandRuntime = commandRuntimeMock.Object;
            this.cmdlet.IntuneClient = intuneClientMock.Object;

            // Set-up mock Location and mock the underlying service API method       
            AzureOperationResponse<Location> resLocation = new AzureOperationResponse<Location>();
            expectedLocation = new Location("mockHostName");
            resLocation.Body = expectedLocation;
    
            intuneClientMock.Setup(f => f.GetLocationByHostNameWithHttpMessagesAsync(It.IsAny<Dictionary<string, List<string>>>(), It.IsAny<CancellationToken>()))
                .Returns(Task.FromResult(resLocation));
        }
コード例 #2
0
        /// <summary>
        ///  C'tor for AddIntuneiOSMAMPolicyAppCmdletTests class.
        /// </summary>
        public AddIntuneiOSMAMPolicyAppCmdletTests()
        {
            commandRuntimeMock = new Mock <ICommandRuntime>();
            intuneClientMock   = new Mock <IIntuneResourceManagementClient>();

            cmdlet = new AddIntuneiOSMAMPolicyAppCmdlet();
            this.cmdlet.CommandRuntime = commandRuntimeMock.Object;
            this.cmdlet.IntuneClient   = intuneClientMock.Object;

            // Set-up mock Location and mock the underlying service API method
            AzureOperationResponse <Location> resLocation = new AzureOperationResponse <Location>();

            expectedLocation = new Location("mockHostName");
            resLocation.Body = expectedLocation;

            intuneClientMock.Setup(f => f.GetLocationByHostNameWithHttpMessagesAsync(It.IsAny <Dictionary <string, List <string> > >(), It.IsAny <CancellationToken>()))
            .Returns(Task.FromResult(resLocation));
        }