public ReleasesController(ILabelRepository labelRepository, IArtistRepository artistRepository, IReleaseRepository releaseRepository, IReleaseService releaseService)
 {
     _labelRepository   = labelRepository;
     _artistRepository  = artistRepository;
     _releaseRepository = releaseRepository;
     _releaseService    = releaseService;
 }
 private ReleaseDataFileService SetupReleaseDataFileService(
     ContentDbContext contentDbContext       = null,
     StatisticsDbContext statisticsDbContext = null,
     IPersistenceHelper <ContentDbContext> contentPersistenceHelper = null,
     IBlobStorageService blobStorageService = null,
     IDataArchiveValidationService dataArchiveValidationService = null,
     IFileUploadsValidatorService fileUploadsValidatorService   = null,
     IFileRepository fileRepository                       = null,
     IReleaseRepository releaseRepository                 = null,
     IReleaseFileRepository releaseFileRepository         = null,
     IReleaseDataFileRepository releaseDataFileRepository = null,
     IDataImportService dataImportService                 = null,
     IUserService userService = null)
 {
     return(new ReleaseDataFileService(
                contentDbContext ?? new Mock <ContentDbContext>().Object,
                contentPersistenceHelper ?? DefaultPersistenceHelperMock().Object,
                blobStorageService ?? new Mock <IBlobStorageService>().Object,
                dataArchiveValidationService ?? new Mock <IDataArchiveValidationService>().Object,
                fileUploadsValidatorService ?? new Mock <IFileUploadsValidatorService>().Object,
                fileRepository ?? new FileRepository(contentDbContext),
                releaseRepository ?? new ReleaseRepository(
                    contentDbContext,
                    statisticsDbContext ?? new Mock <StatisticsDbContext>().Object,
                    Common.Services.MapperUtils.MapperForProfile <MappingProfiles>()),
                releaseFileRepository ?? new ReleaseFileRepository(contentDbContext),
                releaseDataFileRepository ?? new ReleaseDataFileRepository(contentDbContext),
                dataImportService ?? new Mock <IDataImportService>().Object,
                userService ?? new Mock <IUserService>().Object
                ));
 }
Exemplo n.º 3
0
 public ReleaseDataFileService(
     ContentDbContext contentDbContext,
     IPersistenceHelper <ContentDbContext> persistenceHelper,
     IBlobStorageService blobStorageService,
     IDataArchiveValidationService dataArchiveValidationService,
     IFileUploadsValidatorService fileUploadsValidatorService,
     IFileRepository fileRepository,
     IReleaseRepository releaseRepository,
     IReleaseFileRepository releaseFileRepository,
     IReleaseDataFileRepository releaseDataFileRepository,
     IDataImportService dataImportService,
     IUserService userService)
 {
     _contentDbContext             = contentDbContext;
     _persistenceHelper            = persistenceHelper;
     _blobStorageService           = blobStorageService;
     _dataArchiveValidationService = dataArchiveValidationService;
     _fileUploadsValidatorService  = fileUploadsValidatorService;
     _fileRepository            = fileRepository;
     _releaseRepository         = releaseRepository;
     _releaseFileRepository     = releaseFileRepository;
     _releaseDataFileRepository = releaseDataFileRepository;
     _dataImportService         = dataImportService;
     _userService = userService;
 }
Exemplo n.º 4
0
 public SyncJobFacade(
     ILogger <SyncJobFacade> logger,
     ISyncLogRepository syncLogRepository,
     IOctopusRepository octopusRepository,
     ISpaceRepository spaceRepository,
     IProjectRepository projectRepository,
     IEnvironmentRepository environmentRepository,
     ITenantRepository tenantRepository,
     IReleaseRepository releaseRepository,
     IDeploymentRepository deploymentRepository,
     ISyncRepository syncRepository,
     ISyncLogModelFactory syncLogModelFactory)
 {
     _logger                = logger;
     _syncLogRepository     = syncLogRepository;
     _octopusRepository     = octopusRepository;
     _spaceRepository       = spaceRepository;
     _projectRepository     = projectRepository;
     _environmentRepository = environmentRepository;
     _tenantRepository      = tenantRepository;
     _releaseRepository     = releaseRepository;
     _deploymentRepository  = deploymentRepository;
     _syncRepository        = syncRepository;
     _syncLogModelFactory   = syncLogModelFactory;
 }
Exemplo n.º 5
0
        public void Ctor_NullVstsConfig_ThrowsException()
        {
            IReleaseRepository releaseRepository = Substitute.For <IReleaseRepository>();

            Assert.Throws <ArgumentNullException>(() =>
                                                  this.sut = new VstsDeploymentExecutor(releaseRepository, null));
        }
Exemplo n.º 6
0
        public void UpdateApproval_GetsApprovals_UpdatesApproval()
        {
            IVstsReleaseClient releaseClient = Substitute.For <IVstsReleaseClient>();
            IAuthenticator     authenticator = Substitute.For <IAuthenticator>();
            VstsConfig         vstsConfig    = new VstsConfig();

            releaseClient.GetApprovals(Arg.Any <int>(), Arg.Any <string>())
            .Returns(new List <ReleaseApproval>
            {
                new ReleaseApproval {
                    Id = 123
                }
            });

            authenticator.Authenticate().Returns(new AuthenticationResult()
            {
                Success = true
            });

            this.sut = new VstsReleaseRepository(releaseClient, authenticator, vstsConfig);

            this.sut.UpdateApproval("123");

            releaseClient.ReceivedWithAnyArgs(1).UpdateApproval(Arg.Any <int>(), Arg.Any <string>());
        }
Exemplo n.º 7
0
        public void Ctor_NullConfig_ThrowsException()
        {
            IVstsReleaseClient releaseClient = Substitute.For <IVstsReleaseClient>();
            IAuthenticator     authenticator = Substitute.For <IAuthenticator>();

            Assert.Throws <ArgumentNullException>(() =>
                                                  this.sut = new VstsReleaseRepository(releaseClient, authenticator, null));
        }
Exemplo n.º 8
0
        public void Ctor_NullAuthenticator_ThrowsException()
        {
            IVstsReleaseClient releaseClient = Substitute.For <IVstsReleaseClient>();
            VstsConfig         vstsConfig    = new VstsConfig();

            Assert.Throws <ArgumentNullException>(() =>
                                                  this.sut = new VstsReleaseRepository(releaseClient, null, vstsConfig));
        }
Exemplo n.º 9
0
        public void Ctor_NullHttpClient_ThrowsException()
        {
            IAuthenticator authenticator = Substitute.For <IAuthenticator>();
            VstsConfig     vstsConfig    = new VstsConfig();

            Assert.Throws <ArgumentNullException>(() =>
                                                  this.sut = new VstsReleaseRepository(null, authenticator, vstsConfig));
        }
Exemplo n.º 10
0
        public void UpdateReleaseEnvironment_ThrowsException()
        {
            IHttpClient httpClient = Substitute.For <IHttpClient>();

            this.sut = new DockerReleaseRepository("someRepository", httpClient);

            Assert.Throws <NotImplementedException>(() => this.sut.UpdateReleaseEnvironment("someReleaseId", "SomeEnvId"));
        }
Exemplo n.º 11
0
 public OverviewHelper(IReleaseRepository releaseRepository, IReleaseHelper releaseHelper)
 {
     taskItemRepository     = new TaskItemRepository();
     this.releaseRepository = releaseRepository;
     leadTimeHelper         = new LeadTimeHelper();
     this.releaseHelper     = releaseHelper;
     taskItemHelper         = new TaskItemHelper();
 }
Exemplo n.º 12
0
        public void GetReleaseId_NullService_ThrowsException()
        {
            IHttpClient httpClient = Substitute.For <IHttpClient>();

            this.sut = new DockerReleaseRepository("someRepository", httpClient);

            Assert.Throws <ArgumentException>(() => this.sut.GetReleaseId(null));
        }
 public ReleasePathsController(IReleaseRepository releaseRepository)
 {
     if (releaseRepository == null)
     {
         throw new ArgumentNullException("releaseRepository");
     }
     _releaseRepository = releaseRepository;
 }
Exemplo n.º 14
0
 public OverviewHelper(ITaskItemRepository taskItemRepository)
 {
     this.taskItemRepository = taskItemRepository;
     releaseRepository       = new ReleaseRepository();
     leadTimeHelper          = new LeadTimeHelper();
     releaseHelper           = new ReleaseHelper();
     taskItemHelper          = new TaskItemHelper();
 }
Exemplo n.º 15
0
        public DevelopmentService(IBlogRepository blogRepository, IReleaseRepository releaseRepository, 
			IProjectRepository projectRepository)
        {
            _blogRepository = blogRepository;
            _releaseRepository = releaseRepository;
            _projectRepositry = projectRepository;

            _dataAggregator = new DataAggregator();
        }
Exemplo n.º 16
0
        public void Deploy_NullEnvironment_ThrowsException()
        {
            IReleaseRepository releaseRepository = Substitute.For <IReleaseRepository>();
            VstsConfig         vstsConfig        = new VstsConfig();

            this.sut = new VstsDeploymentExecutor(releaseRepository, vstsConfig);

            Assert.Throws <ArgumentException>(() => this.sut.Deploy("someService", environment: null, version: "someVersion"));
        }
Exemplo n.º 17
0
        public void GetEnvironmentId_ReleaseIdNaN_ThrowsException()
        {
            IVstsReleaseClient releaseClient = Substitute.For <IVstsReleaseClient>();
            IAuthenticator     authenticator = Substitute.For <IAuthenticator>();
            VstsConfig         vstsConfig    = new VstsConfig();

            this.sut = new VstsReleaseRepository(releaseClient, authenticator, vstsConfig);

            Assert.Throws <ArgumentException>(() => this.sut.GetReleaseEnvironmentId("someRelease", "999"));
        }
Exemplo n.º 18
0
        public void UpdateReleaseEnvironment_EnvironmentIdNaN_ThrowsException()
        {
            IVstsReleaseClient releaseClient = Substitute.For <IVstsReleaseClient>();
            IAuthenticator     authenticator = Substitute.For <IAuthenticator>();
            VstsConfig         vstsConfig    = new VstsConfig();

            this.sut = new VstsReleaseRepository(releaseClient, authenticator, vstsConfig);

            Assert.Throws <ArgumentException>(() => this.sut.UpdateReleaseEnvironment("123", "someEnvironment"));
        }
Exemplo n.º 19
0
        public void GetReleaseId_NullService_ThrowsException()
        {
            IVstsReleaseClient releaseClient = Substitute.For <IVstsReleaseClient>();
            IAuthenticator     authenticator = Substitute.For <IAuthenticator>();
            VstsConfig         vstsConfig    = new VstsConfig();

            this.sut = new VstsReleaseRepository(releaseClient, authenticator, vstsConfig);

            Assert.Throws <ArgumentException>(() => this.sut.GetReleaseId(null, version: "someVersion"));
        }
Exemplo n.º 20
0
        public void GetReleaseId_HasVersion_ReturnsReleaseId()
        {
            IHttpClient httpClient = Substitute.For <IHttpClient>();

            this.sut = new DockerReleaseRepository("someRepository", httpClient);

            string result = this.sut.GetReleaseId("someService", "someTag");

            Assert.Equal(@"someRepository/someService:someTag", result);
        }
Exemplo n.º 21
0
        public void GetLatest_ThrowsException()
        {
            IVstsReleaseClient releaseClient = Substitute.For <IVstsReleaseClient>();
            IAuthenticator     authenticator = Substitute.For <IAuthenticator>();
            VstsConfig         vstsConfig    = new VstsConfig();

            this.sut = new VstsReleaseRepository(releaseClient, authenticator, vstsConfig);

            Assert.Throws <NotImplementedException>(() => this.sut.GetLatest("someService"));
        }
Exemplo n.º 22
0
        public void GetDeploymentStatus_NullServiceName_ThrowsException()
        {
            IReleaseRepository releaseRepository = Substitute.For <IReleaseRepository>();
            VstsConfig         vstsConfig        = new VstsConfig();

            this.sut = new VstsDeploymentExecutor(releaseRepository, vstsConfig);

            Assert.Throws <ArgumentException>(() => this.sut
                                              .GetDeploymentStatus(null, "someEnvironment", "someVersion"));
        }
Exemplo n.º 23
0
        public void UpdateApproval_NullReleaseId_ThrowsException()
        {
            IVstsReleaseClient releaseClient = Substitute.For <IVstsReleaseClient>();
            IAuthenticator     authenticator = Substitute.For <IAuthenticator>();
            VstsConfig         vstsConfig    = new VstsConfig();

            this.sut = new VstsReleaseRepository(releaseClient, authenticator, vstsConfig);

            Assert.Throws <ArgumentException>(() =>
                                              this.sut.UpdateApproval(null));
        }
Exemplo n.º 24
0
 public CreateReleaseTask(
     ILogger <CreateReleaseTask> logger,
     IReleaseDefinitionRepository releaseDefinitionRepository,
     IBuildRepository buildRepository,
     IReleaseRepository releaseRepository)
 {
     _logger = logger;
     _releaseDefinitionRepository = releaseDefinitionRepository;
     _buildRepository             = buildRepository;
     _releaseRepository           = releaseRepository;
 }
Exemplo n.º 25
0
 public PermalinkService(ITableBuilderService tableBuilderService,
                         IBlobStorageService blobStorageService,
                         ISubjectRepository subjectRepository,
                         IReleaseRepository releaseRepository,
                         IMapper mapper)
 {
     _tableBuilderService = tableBuilderService;
     _blobStorageService  = blobStorageService;
     _subjectRepository   = subjectRepository;
     _releaseRepository   = releaseRepository;
     _mapper = mapper;
 }
Exemplo n.º 26
0
        public void UpdateApproval_AuthenticationFails_ThrowsException()
        {
            IVstsReleaseClient releaseClient = Substitute.For <IVstsReleaseClient>();
            IAuthenticator     authenticator = Substitute.For <IAuthenticator>();
            VstsConfig         vstsConfig    = new VstsConfig();

            authenticator.Authenticate().Returns(new AuthenticationResult());

            this.sut = new VstsReleaseRepository(releaseClient, authenticator, vstsConfig);

            Assert.Throws <AuthenticationException>(() =>
                                                    this.sut.UpdateApproval("123"));
        }
Exemplo n.º 27
0
        public void GetReleaseId_AuthenticationFails_ThrowsException()
        {
            IVstsReleaseClient releaseClient = Substitute.For <IVstsReleaseClient>();
            IAuthenticator     authenticator = Substitute.For <IAuthenticator>();
            VstsConfig         vstsConfig    = new VstsConfig();

            authenticator.Authenticate().Returns(new AuthenticationResult());

            this.sut = new VstsReleaseRepository(releaseClient, authenticator, vstsConfig);

            Assert.Throws <AuthenticationException>(() =>
                                                    this.sut.GetReleaseId("someRelease", "some Version"));
        }
 public FastTrackService(
     ITableBuilderService tableBuilderService,
     IBlobStorageService blobStorageService,
     ITableStorageService tableStorageService,
     IReleaseRepository releaseRepository,
     IMapper mapper)
 {
     _tableBuilderService = tableBuilderService;
     _blobStorageService  = blobStorageService;
     _tableStorageService = tableStorageService;
     _releaseRepository   = releaseRepository;
     _mapper = mapper;
 }
Exemplo n.º 29
0
 public AbstractReleaseService(
     ILogger logger,
     IReleaseRepository releaseRepository,
     IApiReleaseRequestModelValidator releaseModelValidator,
     IBOLReleaseMapper bolReleaseMapper,
     IDALReleaseMapper dalReleaseMapper)
     : base()
 {
     this.releaseRepository     = releaseRepository;
     this.releaseModelValidator = releaseModelValidator;
     this.bolReleaseMapper      = bolReleaseMapper;
     this.dalReleaseMapper      = dalReleaseMapper;
     this.logger = logger;
 }
Exemplo n.º 30
0
        public void Deploy_DoesntGetReleaseId_DoesntGetEnvironmentId()
        {
            IReleaseRepository releaseRepository = Substitute.For <IReleaseRepository>();
            VstsConfig         vstsConfig        = new VstsConfig();

            releaseRepository.GetReleaseId(Arg.Any <string>(), Arg.Any <string>()).Returns((string)null);

            this.sut = new VstsDeploymentExecutor(releaseRepository, vstsConfig);

            sut.Deploy("someService", environment: "someEnvironment", version: "someVersion");

            releaseRepository.DidNotReceiveWithAnyArgs().GetReleaseEnvironmentId(
                default(string), default(string));
        }
Exemplo n.º 31
0
        public void GetDeploymentStatus_GetsReleaseId_GetsEnvironmentId()
        {
            IReleaseRepository releaseRepository = Substitute.For <IReleaseRepository>();
            VstsConfig         vstsConfig        = new VstsConfig();

            releaseRepository.GetReleaseId(Arg.Any <string>(), Arg.Any <string>())
            .Returns("123");

            this.sut = new VstsDeploymentExecutor(releaseRepository, vstsConfig);

            this.sut.GetDeploymentStatus("someService", "someEnvironment", "someVersion");

            releaseRepository.ReceivedWithAnyArgs().GetReleaseEnvironmentId(default(string), default(string));
        }
Exemplo n.º 32
0
 public MainController(IReleaseRepository releaseRepository)
 {
     if (releaseRepository == null) throw new ArgumentNullException("releaseRepository");
     _releaseRepository = releaseRepository;
 }
Exemplo n.º 33
0
 public ReleaseController(IReleaseRepository releaseRepository)
 {
     _releaseRepository = releaseRepository;
 }