public void Should_Throw_If_BuildId_Is_Negative(int buildId) { // Given var collectionUrl = new Uri("http://example.com/collection"); var projectGuid = Guid.NewGuid(); var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = Record.Exception(() => new AzureDevOpsBuildSettings(collectionUrl, projectGuid, buildId, credentials)); // Then result.IsArgumentOutOfRangeException("buildId"); }
public void Should_Throw_If_RepositoryUrl_Is_Null() { // Given Uri repositoryUrl = null; var sourceBranch = "foo"; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = Record.Exception(() => new AzureDevOpsPullRequestSettings(repositoryUrl, sourceBranch, credentials)); // Then result.IsArgumentNullException("repositoryUrl"); }
public void Should_Set_Credentials() { // Given var collectionUrl = new Uri("http://example.com/collection"); var projectGuid = Guid.NewGuid(); var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = new BaseAzureDevOpsProjectSettingsImpl(collectionUrl, projectGuid, credentials); // Then result.Credentials.ShouldBe(credentials); }
public void Should_Set_ProjectGuid() { // Given var collectionUrl = new Uri("http://example.com/collection"); var projectGuid = Guid.NewGuid(); var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = new AzureDevOpsBuildsSettings(collectionUrl, projectGuid, credentials); // Then result.ProjectGuid.ShouldBe(projectGuid); }
public void Should_Throw_If_CollectionUrl_Is_Null() { // Given Uri collectionUrl = null; var projectGuid = Guid.NewGuid(); var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = Record.Exception(() => new BaseAzureDevOpsProjectSettingsImpl(collectionUrl, projectGuid, credentials)); // Then result.IsArgumentNullException("collectionUrl"); }
public void Should_Set_Credentials() { // Given var repositoryUrl = new Uri("http://example.com"); var pullRequestId = 41; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = new TfsPullRequestSettings(repositoryUrl, pullRequestId, credentials); // Then result.Credentials.ShouldBe(credentials); }
public void Should_Set_Repository_Url() { // Given var repositoryUrl = new Uri("http://example.com"); var sourceBranch = "foo"; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = new TfsPullRequestSettings(repositoryUrl, sourceBranch, credentials); // Then result.RepositoryUrl.ShouldBe(repositoryUrl); }
public void Should_Set_Collection_Url() { // Given var collectionUrl = new Uri("http://example.com/collection"); var projectName = "MyProject"; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = new BaseAzureDevOpsProjectSettingsImpl(collectionUrl, projectName, credentials); // Then result.CollectionUrl.ShouldBe(collectionUrl); }
public void Should_Throw_If_ProjectGuid_Is_Empty() { // Given var collectionUrl = new Uri("http://example.com/collection"); var projectGuid = Guid.Empty; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = Record.Exception(() => new BaseAzureDevOpsProjectSettingsImpl(collectionUrl, projectGuid, credentials)); // Then result.IsArgumentOutOfRangeException("projectGuid"); }
public void Should_Throw_If_SourceRefName_Is_WhiteSpace() { // Given var repositoryUrl = new Uri("http://example.com"); var sourceRefName = " "; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = Record.Exception(() => new TfsPullRequestSettings(repositoryUrl, sourceRefName, credentials)); // Then result.IsArgumentOutOfRangeException("sourceRefName"); }
public void Should_Throw_If_RepositoryUrl_Is_Null() { // Given Uri repositoryUrl = null; var pullRequestId = 41; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = Record.Exception(() => new TfsPullRequestSettings(repositoryUrl, pullRequestId, credentials)); // Then result.IsArgumentNullException("repositoryUrl"); }
public void Should_Set_PullRequestId(int pullRequestId) { // Given var repositoryUrl = new Uri("http://example.com"); var credentials = AuthenticationProvider.AuthenticationNtlm(); var settings = new TfsPullRequestSettings(repositoryUrl, pullRequestId, credentials); // When var result = new TfsPullRequestSettings(settings); // Then result.PullRequestId.ShouldBe(pullRequestId); }
public void Should_Throw_If_PullRequestId_Is_Zero() { // Given var repositoryUrl = new Uri("http://example.com"); var pullRequestId = 0; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = Record.Exception(() => new TfsPullRequestSettings(repositoryUrl, pullRequestId, credentials)); // Then result.IsArgumentOutOfRangeException("pullRequestId"); }
public void Should_Throw_If_ProjectName_Is_Null() { // Given var collectionUrl = new Uri("http://example.com/collection"); string projectName = null; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = Record.Exception(() => new BaseAzureDevOpsProjectSettingsImpl(collectionUrl, projectName, credentials)); // Then result.IsArgumentNullException("projectName"); }
public void Should_Set_SourceRefName() { // Given var repositoryUrl = new Uri("http://example.com"); var sourceRefName = "foo"; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = new TfsPullRequestSettings(repositoryUrl, sourceRefName, credentials); // Then result.SourceRefName.ShouldBe(sourceRefName); }
public void Should_Set_Credentials() { // Given var collectionUrl = new Uri("http://example.com/collection"); var projectName = "MyProject"; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = new AzureDevOpsBuildsSettings(collectionUrl, projectName, credentials); // Then result.Credentials.ShouldBe(credentials); }
public void Should_Throw_If_ProjectName_Is_WhiteSpace() { // Given var collectionUrl = new Uri("http://example.com/collection"); var projectName = " "; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = Record.Exception(() => new AzureDevOpsBuildsSettings(collectionUrl, projectName, credentials)); // Then result.IsArgumentOutOfRangeException("projectName"); }
public void Should_Throw_If_CollectionUrl_Is_Null() { // Given Uri collectionUrl = null; var projectName = "MyProject"; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = Record.Exception(() => new AzureDevOpsBuildsSettings(collectionUrl, projectName, credentials)); // Then result.IsArgumentNullException("collectionUrl"); }
public void Should_Throw_If_SourceRefName_Is_Null() { // Given var repositoryUrl = new Uri("http://example.com"); string sourceRefName = null; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = Record.Exception(() => new AzureDevOpsPullRequestSettings(repositoryUrl, sourceRefName, credentials)); // Then result.IsArgumentNullException("sourceRefName"); }
public void Should_Set_Repository_Url() { // Given var repositoryUrl = new Uri("http://example.com"); var pullRequestId = 41; var credentials = AuthenticationProvider.AuthenticationNtlm(); var settings = new AzureDevOpsPullRequestSettings(repositoryUrl, pullRequestId, credentials); // When var result = new AzureDevOpsPullRequestSettings(settings); // Then result.RepositoryUrl.ShouldBe(repositoryUrl); }
public void Should_Set_ProjectName() { // Given var collectionUrl = new Uri("http://example.com/collection"); var projectName = "MyProject"; var buildId = 42; var credentials = AuthenticationProvider.AuthenticationNtlm(); var settings = new AzureDevOpsBuildSettings(collectionUrl, projectName, buildId, credentials); // When var result = new AzureDevOpsBuildSettings(settings); // Then result.ProjectName.ShouldBe(projectName); }
public void Should_Set_Collection_Url() { // Given var collectionUrl = new Uri("http://example.com/collection"); var projectGuid = Guid.NewGuid(); var buildId = 42; var credentials = AuthenticationProvider.AuthenticationNtlm(); var settings = new AzureDevOpsBuildSettings(collectionUrl, projectGuid, buildId, credentials); // When var result = new AzureDevOpsBuildSettings(settings); // Then result.CollectionUrl.ShouldBe(collectionUrl); }
public void Should_Set_Description(string description) { // Given var repositoryUrl = new Uri("http://example.com"); var sourceRefName = "foo"; var targetRefName = "master"; var title = "foo"; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = new AzureDevOpsCreatePullRequestSettings(repositoryUrl, sourceRefName, targetRefName, title, description, credentials); // Then result.Description.ShouldBe(description); }
public void Should_Set_TargetRefName(string targetRefName) { // Given var repositoryUrl = new Uri("http://example.com"); var sourceRefName = "foo"; var title = "foo"; var description = "bar"; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = new TfsCreatePullRequestSettings(repositoryUrl, sourceRefName, targetRefName, title, description, credentials); // Then result.TargetRefName.ShouldBe(targetRefName); }
public void Should_Set_ThrowExceptionIfPullRequestCouldNotBeFound(bool value) { // Given var repositoryUrl = new Uri("http://example.com"); var pullRequestId = 41; var credentials = AuthenticationProvider.AuthenticationNtlm(); var settings = new TfsPullRequestSettings(repositoryUrl, pullRequestId, credentials) { ThrowExceptionIfPullRequestCouldNotBeFound = value, }; // When var result = new TfsPullRequestSettings(settings); // Then result.ThrowExceptionIfPullRequestCouldNotBeFound.ShouldBe(value); }
public void Should_Throw_If_Title_Is_Null() { // Given var repositoryUrl = new Uri("http://example.com"); var sourceRefName = "foo"; var targetRefName = "master"; string title = null; var description = "bar"; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = Record.Exception(() => new AzureDevOpsCreatePullRequestSettings(repositoryUrl, sourceRefName, targetRefName, title, description, credentials)); // Then result.IsArgumentNullException("title"); }
public void Should_Set_ThrowExceptionIfBuildCouldNotBeFound(bool value) { // Given var collectionUrl = new Uri("http://example.com/collection"); var projectName = "MyProject"; var buildId = 42; var credentials = AuthenticationProvider.AuthenticationNtlm(); var settings = new AzureDevOpsBuildSettings(collectionUrl, projectName, buildId, credentials) { ThrowExceptionIfBuildCouldNotBeFound = value, }; // When var result = new AzureDevOpsBuildSettings(settings); // Then result.ThrowExceptionIfBuildCouldNotBeFound.ShouldBe(value); }
public void Should_Throw_If_RepositoryUrl_Is_Null() { // Given Uri repositoryUrl = null; var sourceRefName = "foo"; var targetRefName = "master"; var title = "foo"; var description = "bar"; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = Record.Exception(() => new TfsCreatePullRequestSettings(repositoryUrl, sourceRefName, targetRefName, title, description, credentials)); // Then result.IsArgumentNullException("repositoryUrl"); }
public void Should_Throw_If_SourceRefName_Is_Empty() { // Given var repositoryUrl = new Uri("http://example.com"); var sourceRefName = string.Empty; var targetRefName = "master"; var title = "foo"; var description = "bar"; var credentials = AuthenticationProvider.AuthenticationNtlm(); // When var result = Record.Exception(() => new TfsCreatePullRequestSettings(repositoryUrl, sourceRefName, targetRefName, title, description, credentials)); // Then result.IsArgumentOutOfRangeException("sourceRefName"); }