public async Task RunActivity_ValidatesTrigger() { var content = CreatePushData("by-pinja", "repository-validator-testing"); var instanceId = CreateInstanceId(content); _mockDurableClient.StartNewAsync(Arg.Any <string>(), Arg.Any <object>()).Returns(Task.FromResult(instanceId)); _mockDurableClient.GetStatusAsync(Arg.Any <string>()).Returns(Task.FromResult <DurableOrchestrationStatus>(null)); _mockDurableClient.CreateCheckStatusResponse(Arg.Any <HttpRequestMessage>(), instanceId).Returns(new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(string.Empty) }); var request = new HttpRequestMessage() { Content = new StringContent(JsonConvert.SerializeObject(content), System.Text.Encoding.UTF8, "application/json"), }; var result = await RepositoryValidatorEndpoint.RepositoryValidatorTrigger(request, _mockDurableClient, Substitute.For <ILogger>()); Assert.AreEqual(result.StatusCode, HttpStatusCode.OK); await _mockDurableClient.Received().StartNewAsync(Arg.Any <string>(), Arg.Any <string>(), Arg.Any <object>()); _mockDurableClient.Received().CreateCheckStatusResponse(Arg.Any <HttpRequestMessage>(), instanceId); }