public void Run_ThrowsArgumentNullException() { // Arrange var mockService = new Mock <IContractStatusChangePublisher>(MockBehavior.Strict); var function = new ContractReadyToReviewNotifierServiceBusFunction(mockService.Object); // Act Func <Task> act = async() => { await function.RunAsync(null, null); }; // Assert act.Should().Throw <ArgumentNullException>(); mockService.VerifyNoOtherCalls(); }
public void Run_DoesNotThrowException() { // Arrange var mockService = new Mock <IContractStatusChangePublisher>(MockBehavior.Strict); mockService .Setup(e => e.NotifyContractChangesAreReadyForReviewAsync(It.IsAny <Contract>())) .Returns(Task.CompletedTask) .Verifiable(); var function = new ContractReadyToReviewNotifierServiceBusFunction(mockService.Object); // Act Func <Task> act = async() => { await function.RunAsync(new Contract(), null); }; // Assert act.Should().NotThrow(); mockService.Verify(); }