Skip to content

Instantly share code, notes, and snippets.

@KevinDJones
Last active November 15, 2018 05:10
Show Gist options
  • Save KevinDJones/361e469db916bafeb1c04fce694ea352 to your computer and use it in GitHub Desktop.
Save KevinDJones/361e469db916bafeb1c04fce694ea352 to your computer and use it in GitHub Desktop.
[TestMethod]
public async Task TestSending()
{
var clientMock = new Mock<DurableOrchestrationClientBase>();
var logMock = new Mock<ILogger>();
var orchestrationId = "testId";
// Mock return value of an orchestration
clientMock.Setup(context => context.StartNewAsync("O_SendEmail", It.IsAny<object>())).Returns(Task.FromResult(orchestrationId));
var input = new MyClass();
var requestMessage = new HttpRequestMessage();
requestMessage.Content = new StringContent(JsonConvert.SerializeObject(input), Encoding.UTF8, "application/json");
requestMessage = TestHelpers.SetupHttp(requestMessage);
var result = await MyStarter.Run(requestMessage, this.clientMock.Object, this.logMock.Object);
Assert.AreEqual(result.StatusCode, HttpStatusCode.OK);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment