public void SetUp()
 {
     requester         = new SampleRequest();
     mockRequester     = new SampleMockRequest();
     mockListRequester = new SampleListMockRequest();
     errorRequester    = new SampleErrorRequest();
 }
Beispiel #2
0
    void Start()
    {
        var request = new SampleRequest();

        request.Get
        .Subscribe(x =>
        {
            Debug.Log(x.title);
        })
        .AddTo(this);

        var mockRequest = new SampleMockRequest();

        mockRequest.Get
        .Subscribe(x =>
        {
            Debug.Log(x.title);
        })
        .AddTo(this);

        var mockListRequest = new SampleListMockRequest();

        mockListRequest.Get
        .Subscribe(x =>
        {
            x.ForEach(xx => Debug.Log(xx.title));
        })
        .AddTo(this);

        var errorRequest = new SampleErrorRequest();

        errorRequest.Get
        .Subscribe(x =>
        {
            Debug.Log(x.title);
        })
        .AddTo(this);

        var param = new SampleParamter(city: 130010);

        request.Dispatch(param);
        mockRequest.Dispatch(param);
        mockListRequest.Dispatch(param);
        errorRequest.Dispatch(param);
    }