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
{ | |
"name": ".NET Core Attach", | |
"type": "coreclr", | |
"request": "attach", | |
"processId": "${command:pickProcess}" | |
} |
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
{ | |
"label":"test", | |
"command":"dotnet", | |
"type":"process", | |
"args":[ | |
"test", | |
"${workspaceFolder}/test/MyProject.Tests.csproj" | |
], | |
"problemMatcher":"$msCompile", | |
"group":{ |
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
[FunctionName("A_Send")] | |
public static void Send( | |
[ActivityTrigger] DurableActivityContext context) | |
{} |
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
[FunctionName("A_Send")] | |
public static void Send( | |
[ActivityTrigger] MyClass classObject) | |
{} |
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
var contextMock = new Mock<DurableOrchestrationContextBase>(); | |
var logMock = new Mock<ILogger>(); | |
var input = new MyClass(); | |
var result = new MyOtherClass(); | |
contextMock.Setup(context => context.GetInput<EmailInput>()).Returns(input); | |
contextMock.Setup(context => context.CallActivityAsync<EmailResult>("A_Send", input)).Returns(Task.FromResult<EmailResult>(result)); | |
var orchestrationResult = await Orchestrators.EmailSender(this.contextMock.Object, this.logMock.Object); |
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
[FunctionName("O_SendEmail")] | |
public static async Task EmailSender( | |
[OrchestrationTrigger] DurableOrchestrationContextBase context, | |
ILogger log) | |
{} |
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(); |
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
using System; | |
using System.Collections.Generic; | |
using System.Net.Http; | |
using System.Net.Http.Formatting; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc.WebApiCompatShim; | |
using Microsoft.Extensions.Options; | |
using Moq; | |
namespace Messaging.Tests |
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
var clientMock = new Mock<DurableOrchestrationClientBase>(); | |
var logMock = new Mock<ILogger>(); | |
clientMock.Setup(context => context.StartNewAsync("O_SendEmail", It.IsAny<object>())).Returns(Task.FromResult(orchestrationId)); | |
var result = await MyStarter.Run(requestMessage, this.clientMock.Object, this.logMock.Object); |
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
[FunctionName("MyStarter")] | |
public static async Task<HttpResponseMessage> Run( | |
[HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequestMessage req, | |
[OrchestrationClient] DurableOrchestrationClientBase starter, | |
ILogger log) | |
{} |
NewerOlder