public void Extract(ExtractArgs args) { args.Validate(); var connectionString = args.GetConnectionString(); using (var connection = new SqlConnection(connectionString)) { connection.Open(); Log.Information( LoggingMessageTemplates.Extract, args.SchemaName, args.DeploymentId, args.TargetDirectory, args.DatabaseName, args.ServerName, args.NoVerify); DeploymentHistory.Extract( args.DeploymentId, connection, args.SchemaName, args.TargetDirectory, args.NoVerify); connection.Close(); } }
public virtual BODeploymentHistory MapEFToBO( DeploymentHistory ef) { var bo = new BODeploymentHistory(); bo.SetProperties( ef.DeploymentId, ef.ChannelId, ef.ChannelName, ef.CompletedTime, ef.Created, ef.DeployedBy, ef.DeploymentName, ef.DurationSeconds, ef.EnvironmentId, ef.EnvironmentName, ef.ProjectId, ef.ProjectName, ef.ProjectSlug, ef.QueueTime, ef.ReleaseId, ef.ReleaseVersion, ef.StartTime, ef.TaskId, ef.TaskState, ef.TenantId, ef.TenantName); return(bo); }
public virtual DeploymentHistory MapBOToEF( BODeploymentHistory bo) { DeploymentHistory efDeploymentHistory = new DeploymentHistory(); efDeploymentHistory.SetProperties( bo.ChannelId, bo.ChannelName, bo.CompletedTime, bo.Created, bo.DeployedBy, bo.DeploymentId, bo.DeploymentName, bo.DurationSeconds, bo.EnvironmentId, bo.EnvironmentName, bo.ProjectId, bo.ProjectName, bo.ProjectSlug, bo.QueueTime, bo.ReleaseId, bo.ReleaseVersion, bo.StartTime, bo.TaskId, bo.TaskState, bo.TenantId, bo.TenantName); return(efDeploymentHistory); }
public void MapEFToBO() { var mapper = new DALDeploymentHistoryMapper(); DeploymentHistory entity = new DeploymentHistory(); entity.SetProperties("A", "A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", 1, "A", "A", "A", "A", "A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", "A"); BODeploymentHistory response = mapper.MapEFToBO(entity); response.ChannelId.Should().Be("A"); response.ChannelName.Should().Be("A"); response.CompletedTime.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM")); response.Created.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM")); response.DeployedBy.Should().Be("A"); response.DeploymentId.Should().Be("A"); response.DeploymentName.Should().Be("A"); response.DurationSeconds.Should().Be(1); response.EnvironmentId.Should().Be("A"); response.EnvironmentName.Should().Be("A"); response.ProjectId.Should().Be("A"); response.ProjectName.Should().Be("A"); response.ProjectSlug.Should().Be("A"); response.QueueTime.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM")); response.ReleaseId.Should().Be("A"); response.ReleaseVersion.Should().Be("A"); response.StartTime.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM")); response.TaskId.Should().Be("A"); response.TaskState.Should().Be("A"); response.TenantId.Should().Be("A"); response.TenantName.Should().Be("A"); }
public void MapEFToBOList() { var mapper = new DALDeploymentHistoryMapper(); DeploymentHistory entity = new DeploymentHistory(); entity.SetProperties("A", "A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", 1, "A", "A", "A", "A", "A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", "A"); List <BODeploymentHistory> response = mapper.MapEFToBO(new List <DeploymentHistory>() { entity }); response.Count.Should().Be(1); }
public async void Get() { var mock = new ServiceMockFacade <IDeploymentHistoryRepository>(); var record = new DeploymentHistory(); mock.RepositoryMock.Setup(x => x.Get(It.IsAny <string>())).Returns(Task.FromResult(record)); var service = new DeploymentHistoryService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.DeploymentHistoryModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLDeploymentHistoryMapperMock, mock.DALMapperMockFactory.DALDeploymentHistoryMapperMock); ApiDeploymentHistoryResponseModel response = await service.Get(default(string)); response.Should().NotBeNull(); mock.RepositoryMock.Verify(x => x.Get(It.IsAny <string>())); }