예제 #1
0
    public BehaviourResponseBuilder <BehaviourBuilder <T> > AddResponse(string name)
    {
        var response = BehaviourResponse <BehaviourBuilder <T> > .Create(this, name);

        Instance.Response = response.Instance;
        return(response);
    }
예제 #2
0
    public static BehaviourResponseBuilder <TBuilder> Create(TBuilder model, string name)
    {
        if (model is null)
        {
            throw new ArgumentNullException(nameof(model));
        }

        if (string.IsNullOrWhiteSpace(name))
        {
            throw new ArgumentNullException(name);
        }

        var behaviour = new BehaviourResponse(name);

        return(new BehaviourResponseBuilder <TBuilder>(model, behaviour));
    }
예제 #3
0
 public BehaviourResponseBuilder(TBuilder builder, BehaviourResponse response)
 {
     Build    = builder;
     Instance = response ?? throw new ArgumentNullException(nameof(response));
 }