public void NewBatchComputeNodeUserParametersTest()
        {
            // Setup cmdlet without the required parameters
            BatchAccountContext context = BatchTestHelpers.CreateBatchContextWithKeys();

            cmdlet.BatchContext = context;

            Assert.Throws <ArgumentNullException>(() => cmdlet.ExecuteCmdlet());

            cmdlet.PoolId        = "testPool";
            cmdlet.ComputeNodeId = "computeNode1";

            Assert.Throws <ArgumentNullException>(() => cmdlet.ExecuteCmdlet());
            cmdlet.Name = "testUser";

            Assert.Throws <ArgumentNullException>(() => cmdlet.ExecuteCmdlet());
            cmdlet.Password = "******";

            // Don't go to the service on an Add ComputeNodeUser call
            RequestInterceptor interceptor = BatchTestHelpers.CreateNoOpInterceptor <ComputeNodeAddUserParameters, ComputeNodeAddUserResponse>();

            cmdlet.AdditionalBehaviors = new List <BatchClientBehavior>()
            {
                interceptor
            };

            // Verify no exceptions when required parameters are set
            cmdlet.ExecuteCmdlet();
        }
        public void NewBatchComputeNodeUserParametersTest()
        {
            // Setup cmdlet without the required parameters
            BatchAccountContext context = BatchTestHelpers.CreateBatchContextWithKeys();

            cmdlet.BatchContext = context;

            Assert.Throws <ArgumentNullException>(() => cmdlet.ExecuteCmdlet());

            cmdlet.PoolId        = "testPool";
            cmdlet.ComputeNodeId = "computeNode1";

            Assert.Throws <ArgumentNullException>(() => cmdlet.ExecuteCmdlet());
            cmdlet.Name = "testUser";

            Assert.Throws <ArgumentNullException>(() => cmdlet.ExecuteCmdlet());
            cmdlet.Password = "******";

            // Don't go to the service on an Add ComputeNodeUser call
            RequestInterceptor interceptor = new RequestInterceptor((baseRequest) =>
            {
                BatchRequest <ComputeNodeAddUserParameters, ComputeNodeAddUserResponse> request =
                    (BatchRequest <ComputeNodeAddUserParameters, ComputeNodeAddUserResponse>)baseRequest;

                request.ServiceRequestFunc = (cancellationToken) =>
                {
                    ComputeNodeAddUserResponse response    = new ComputeNodeAddUserResponse();
                    Task <ComputeNodeAddUserResponse> task = Task.FromResult(response);
                    return(task);
                };
            });

            cmdlet.AdditionalBehaviors = new List <BatchClientBehavior>()
            {
                interceptor
            };

            // Verify no exceptions when required parameters are set
            cmdlet.ExecuteCmdlet();
        }