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