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))
     });
Example #2
0
 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))
     });
Example #3
0
 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))
     });
Example #4
0
 public static string Self(IMspecElement element)
 {
     return(Create(element).Id);
 }
Example #5
0
 private MspecRemoteTask GetRemoteTask(IMspecElement element)
 {
     return(RemoteTaskBuilder.GetRemoteTask(element));
 }