public async Task PathsCosmosDbTriggerWhenExecutedThrowsException() { A.CallTo(() => legacyDataLoadService.UpdatePathAsync(A <LegacyPathModel> .Ignored)).ThrowsAsync(new HttpRequestException()); // Arrange var function = new PathsCosmosDbTrigger(logger, legacyDataLoadService); // Act // Assert await Assert.ThrowsAsync <HttpRequestException>(() => function.Run(new List <Document> { ModelBuilders.ValidLegacyPathModel(ModelBuilders.PathName) })).ConfigureAwait(false); }
public async Task PathsCosmosDbTriggerWhenExecutedUpdatesPath() { // Arrange var function = new PathsCosmosDbTrigger(logger, legacyDataLoadService); // Act await function.Run(new List <Document> { ModelBuilders.ValidLegacyPathModel(ModelBuilders.PathName) }).ConfigureAwait(false); // Assert A.CallTo(() => legacyDataLoadService.UpdatePathAsync(A <LegacyPathModel> .Ignored)).MustHaveHappenedOnceExactly(); }