public void GenericFail1Test() { ResourcesEstimator sim = new ResourcesEstimator(); { try { QVoid res = sim.Execute <GenericFail1, QVoid, QVoid>(QVoid.Instance); } catch (ExecutionFailException) { StackFrame[] stackFrames = sim.CallStack; Assert.Equal(3, stackFrames.Length); Assert.Equal(namespacePrefix + "AlwaysFail", stackFrames[0].Callable.FullName); Assert.Equal(namespacePrefix + "GenericFail", stackFrames[1].Callable.FullName); Assert.Equal(namespacePrefix + "GenericFail1", stackFrames[2].Callable.FullName); Assert.Equal(OperationFunctor.Body, stackFrames[0].Callable.Variant); Assert.Equal(OperationFunctor.Body, stackFrames[1].Callable.Variant); Assert.Equal(OperationFunctor.Body, stackFrames[2].Callable.Variant); Assert.Equal(7, stackFrames[0].FailedLineNumber); Assert.Equal(25, stackFrames[1].FailedLineNumber); Assert.Equal(29, stackFrames[2].FailedLineNumber); } } { try { QVoid res = sim.Execute <GenericAdjFail1, QVoid, QVoid>(QVoid.Instance); } catch (ExecutionFailException) { StackFrame[] stackFrames = sim.CallStack; Assert.Equal(3, stackFrames.Length); Assert.Equal(namespacePrefix + "AlwaysFail", stackFrames[0].Callable.FullName); Assert.Equal(namespacePrefix + "GenericFail", stackFrames[1].Callable.FullName); Assert.Equal(namespacePrefix + "GenericAdjFail1", stackFrames[2].Callable.FullName); Assert.Equal(OperationFunctor.Adjoint, stackFrames[0].Callable.Variant); Assert.Equal(OperationFunctor.Adjoint, stackFrames[1].Callable.Variant); Assert.Equal(OperationFunctor.Body, stackFrames[2].Callable.Variant); Assert.Equal(6, stackFrames[0].FailedLineNumber); Assert.Equal(24, stackFrames[1].FailedLineNumber); Assert.Equal(52, stackFrames[2].FailedLineNumber); } } { try { QVoid res = sim.Execute <GenericCtlFail1, QVoid, QVoid>(QVoid.Instance); } catch (ExecutionFailException) { StackFrame[] stackFrames = sim.CallStack; Assert.Equal(3, stackFrames.Length); Assert.Equal(namespacePrefix + "AlwaysFail", stackFrames[0].Callable.FullName); Assert.Equal(namespacePrefix + "GenericFail", stackFrames[1].Callable.FullName); Assert.Equal(namespacePrefix + "GenericCtlFail1", stackFrames[2].Callable.FullName); Assert.Equal(OperationFunctor.Controlled, stackFrames[0].Callable.Variant); Assert.Equal(OperationFunctor.Controlled, stackFrames[1].Callable.Variant); Assert.Equal(OperationFunctor.Body, stackFrames[2].Callable.Variant); Assert.Equal(6, stackFrames[0].FailedLineNumber); Assert.Equal(24, stackFrames[1].FailedLineNumber); Assert.Equal(56, stackFrames[2].FailedLineNumber); } } }