Esempio n. 1
0
 public async Task UpdateStepArtifact(StepArtifact stepArtifact)
 {
     using (var db = await DbConnectionFactory.OpenAsync())
     {
         await db.UpdateStepArtifact(stepArtifact);
     }
 }
Esempio n. 2
0
 public async Task <ulong> CreateStepArtifact(StepArtifact stepArtifact)
 {
     using (var db = await DbConnectionFactory.OpenAsync())
     {
         return(await db.CreateOrUpdateStepArtifact(stepArtifact));
     }
 }
Esempio n. 3
0
        public async Task It_Should_Delete_Step_Artifact()
        {
            // Arrange
            batchRepository.DoesBatchExist(Arg.Any <string>())
            .Returns(true);

            stepRepository.Get(Arg.Any <string>(), Arg.Any <string>())
            .Returns(new Step());

            var existingStepArtifact = new StepArtifact
            {
                Id = 123
            };

            stepRepository.GetStepArtifact(Arg.Any <ulong>(), Arg.Any <string>())
            .Returns(existingStepArtifact);

            var request = new DeleteStepArtifactRequest();

            // Act
            var response = await Sut.Delete(request);

            // Assert
            response.Should().NotBeNull();
            await stepRepository.Received().DeleteStepArtifact(Arg.Is <ulong>(a =>
                                                                              a == existingStepArtifact.Id));
        }
Esempio n. 4
0
 internal static async Task UpdateStepArtifact(this IDbConnection db, StepArtifact artifact)
 {
     await db.UpdateAsync(artifact);
 }
Esempio n. 5
0
        internal static async Task <ulong> CreateOrUpdateStepArtifact(this IDbConnection db, StepArtifact artifact)
        {
            await db.SaveAsync(artifact, true);

            return(artifact.Id);
        }