Last active
November 15, 2018 05:10
-
-
Save KevinDJones/361e469db916bafeb1c04fce694ea352 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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