예제 #1
0
 public async Task UpdateStepArtifact(StepArtifact stepArtifact)
 {
     using (var db = await DbConnectionFactory.OpenAsync())
     {
         await db.UpdateStepArtifact(stepArtifact);
     }
 }
예제 #2
0
 public async Task <ulong> CreateStepArtifact(StepArtifact stepArtifact)
 {
     using (var db = await DbConnectionFactory.OpenAsync())
     {
         return(await db.CreateOrUpdateStepArtifact(stepArtifact));
     }
 }
예제 #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));
        }
예제 #4
0
 internal static async Task UpdateStepArtifact(this IDbConnection db, StepArtifact artifact)
 {
     await db.UpdateAsync(artifact);
 }
예제 #5
0
        internal static async Task <ulong> CreateOrUpdateStepArtifact(this IDbConnection db, StepArtifact artifact)
        {
            await db.SaveAsync(artifact, true);

            return(artifact.Id);
        }