Skip to content

Instantly share code, notes, and snippets.

View deadwards90's full-sized avatar

Daniel Edwards deadwards90

View GitHub Profile
@deadwards90
deadwards90 / Example.cs
Created July 8, 2019 14:38
Example code showing orchestration behaviour
public class MainOrchestrator
{
[FunctionName(nameof(MainOrchestrator))]
public static async Task<bool> RunOrchestrator(
[OrchestrationTrigger] DurableOrchestrationContextBase context,
ILogger logger)
{
var subTasks = new List<Task>();
for(var i = 0; i < 10000; i++)
subTasks.Add(context.CallSubOrchestratorAsync<ReturnObject>(nameof(SubOrchestrator), i));
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
namespace App.API.Tests.Integration
{
[TestFixture]
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.2.0" />
<PackageReference Include="nunit" Version="3.11.0" />
@deadwards90
deadwards90 / APIWebApplicationFactory.cs
Last active June 1, 2021 11:27
WebApplicationFactory wrapper for Nunit
using Microsoft.AspNetCore.Mvc.Testing;
namespace App.API.Tests.Integration
{
public class APIWebApplicationFactory : WebApplicationFactory<App.API.Startup>
{
}
}