public void CanListDataFactoryActivityWindows() { cmdlet = new GetAzureDataFactoryActivityWindowsCommand() { CommandRuntime = commandRuntimeMock.Object, DataFactoryClient = dataFactoriesClientMock.Object, ResourceGroupName = ResourceGroupName, DataFactoryName = DataFactoryName }; dataFactoriesClientMock .Setup( c => c.ListByDataFactoryActivityWindows(It.IsAny <string>(), It.Is <ActivityWindowsByDataFactoryListParameters>( options => options.ResourceGroupName == ResourceGroupName && options.DataFactoryName == DataFactoryName))) .Returns(this.response) .Verifiable(); // Action cmdlet.ExecuteCmdlet(); // Assert dataFactoriesClientMock.VerifyAll(); commandRuntimeMock.Verify(f => f.WriteObject(It.Is <List <PSActivityWindow> >(x => this.ValidateResult(x)), true), Times.Once()); }
public void CanThrowWarningWhenBadArgumentPassed() { cmdlet = new GetAzureDataFactoryActivityWindowsCommand() { CommandRuntime = commandRuntimeMock.Object, DataFactoryClient = dataFactoriesClientMock.Object, ResourceGroupName = ResourceGroupName, DataFactoryName = DataFactoryName, DatasetName = datasetName, PipelineName = pipelineName, ActivityName = activityName }; // Action cmdlet.ExecuteCmdlet(); // Assert dataFactoriesClientMock.VerifyAll(); commandRuntimeMock.Verify(f => f.WriteWarning(It.Is <string>(x => x.Contains("An incorrect combination of arguments was passed"))), Times.Once()); }
public void CanListDataFactoryActivityWindows() { cmdlet = new GetAzureDataFactoryActivityWindowsCommand() { CommandRuntime = commandRuntimeMock.Object, DataFactoryClient = dataFactoriesClientMock.Object, ResourceGroupName = ResourceGroupName, DataFactoryName = DataFactoryName }; dataFactoriesClientMock .Setup( c => c.ListByDataFactoryActivityWindows(It.IsAny<string>(), It.Is<ActivityWindowsByDataFactoryListParameters>( options => options.ResourceGroupName == ResourceGroupName && options.DataFactoryName == DataFactoryName))) .Returns(this.response) .Verifiable(); // Action cmdlet.ExecuteCmdlet(); // Assert dataFactoriesClientMock.VerifyAll(); commandRuntimeMock.Verify(f => f.WriteObject(It.Is<List<PSActivityWindow>>(x => this.ValidateResult(x)), true), Times.Once()); }
public void CanThrowWarningWhenBadArgumentPassed() { cmdlet = new GetAzureDataFactoryActivityWindowsCommand() { CommandRuntime = commandRuntimeMock.Object, DataFactoryClient = dataFactoriesClientMock.Object, ResourceGroupName = ResourceGroupName, DataFactoryName = DataFactoryName, DatasetName = datasetName, PipelineName = pipelineName, ActivityName = activityName }; // Action cmdlet.ExecuteCmdlet(); // Assert dataFactoriesClientMock.VerifyAll(); commandRuntimeMock.Verify(f => f.WriteWarning(It.Is<string>(x => x.Contains("An incorrect combination of arguments was passed"))), Times.Once()); }