public static MspecRemoteTask GetRemoteTask(IMspecElement element) { return(element switch { IContextElement context => FromContext(context), IBehaviorElement behavior => FromBehavior(behavior), ISpecificationElement specification => FromSpecification(specification), _ => throw new ArgumentOutOfRangeException(nameof(element)) });
public static MspecReSharperId Create(IMspecElement element) { return(element switch { IContextElement context => new MspecReSharperId(context), ISpecificationElement specification => new MspecReSharperId(specification), IBehaviorElement behavior => new MspecReSharperId(behavior), _ => throw new ArgumentOutOfRangeException(nameof(element)) });
private IMspecElement?GetParent(IMspecElement element) { return(element switch { IContextElement => null, IBehaviorElement behavior => behavior.Context, ISpecificationElement { Behavior : null } specification => specification.Context, ISpecificationElement { Behavior : not null } specification => specification.Behavior, _ => throw new ArgumentOutOfRangeException(nameof(element)) });
public static string Self(IMspecElement element) { return(Create(element).Id); }
private MspecRemoteTask GetRemoteTask(IMspecElement element) { return(RemoteTaskBuilder.GetRemoteTask(element)); }