← 输入框|github.com|刷新
Skip to content
This repository was archived by the owner on Nov 29, 2021. It is now read-only.
This repository was archived by the owner on Nov 29, 2021. It is now read-only.

Add the ability to force a connection error #84

Open

Description

@mhenry1384

I have automated tests, one of which checks what happens in my code if I can't make a connection to Dropbox. To do that, I added a method to Dropnet that lets me override the ApiBaseUrl to something bogus (like "http://192.168.66.66/boo/nonny").

To do that, I have to alter Dropnet. It would be nice if out of the box there was some way to change the ApiBaseUrl, or in some other way force a connection error.

Activity

  1. mhenry1384 commented on Dec 10, 2012

    @mhenry1384
    Author

    Here's my code in DropNetClient

        public string UnitTestUriOverride 
        { 
            set
            {
                _restClient.BaseUrl = value;
                _restClientContent.BaseUrl = value;
            }
        }
    
  2. dkarzon commented on Dec 10, 2012

    @dkarzon
    Member

    Could you create a class that inherits the DropNet class as overrides the urls with that?
    Not too sure I like the idea of having "test only" properties.

  3. mhenry1384 commented on Dec 10, 2012

    @mhenry1384
    Author

    I could if DropNetClient's _restClient and _restClientContent were protected instead of private.

  4. mhenry1384 commented on Dec 12, 2012

    @mhenry1384
    Author

    ApiBaseUrl should also be protected so it can be overridden when it's used by DropNetClient.GetTokenAsync().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions