public async Task FuncWithAllOptionalInputsOutputWorks() { Func <string, Func <FuncWithAllOptionalInputsInvokeArgs?>, Task> check = ( (expected, args) => Assert .Output(() => FuncWithAllOptionalInputs.Invoke(args()).Apply(x => x.R)) .ResolvesTo(expected) ); await check("a=null b=null", () => null); await check("a=null b=null", () => new FuncWithAllOptionalInputsInvokeArgs()); await check("a=my-a b=null", () => new FuncWithAllOptionalInputsInvokeArgs { A = Out("my-a"), }); await check("a=null b=my-b", () => new FuncWithAllOptionalInputsInvokeArgs { B = Out("my-b"), }); await check("a=my-a b=my-b", () => new FuncWithAllOptionalInputsInvokeArgs { A = Out("my-a"), B = Out("my-b"), }); }
public async Task DependenciesPropagate() { await Assert.Output(() => { var dep = new MockDep("res1"); var args = new FuncWithAllOptionalInputsInvokeArgs { A = dep.MockDepOutput, }; return(FuncWithAllOptionalInputs.Invoke(args).Apply(x => x.R)); }).DependsOn("mockdep::res1"); }