public void Startup() { var tokenUrl = "http://token.asana.com/"; var anyUrl = "http://asana.com"; _restClientMock = new Mock <IRestfulServiceClient>(); _restClient = _restClientMock.Object; _parametersMock = new Mock <IAsanaParameters>(); _parametersMock.Setup(x => x.MinutesBeforeTokenRenewal).Returns("10"); // Url`s setup _parametersMock.Setup(x => x.AsanaOAuthTokenUrl).Returns(tokenUrl); _parametersMock.Setup(x => x.WorkspacesUrl).Returns(anyUrl); _parametersMock.Setup(x => x.UsersInWorkspaceUrl).Returns(anyUrl + "/workspaces"); _parametersMock.Setup(x => x.UsersMeUrl).Returns(anyUrl + "/me"); _parametersMock.Setup(x => x.UsersUrl).Returns(anyUrl + "/users"); _parametersMock.Setup(x => x.TasksUrl).Returns(anyUrl + "/tasks"); _parametersMock.Setup(x => x.StoriesUrl).Returns(anyUrl + "/stories"); _parameters = _parametersMock.Object; //for token refreshing _restClientMock.Setup( x => x.PostAsync <JObject>(It.Is <Uri>(y => y.AbsoluteUri.Equals(tokenUrl)), It.IsAny <HttpContent>(), It.IsAny <string>(), It.IsAny <Dictionary <string, string> >())) .ReturnsAsync(JObject.Parse(FixtureData.SampleAsanaOauthTokenResponse())); }
public AsanaOAuthService(IRestfulServiceClient client, IAsanaParameters parameters) { _restfulClient = client; _parameters = parameters; OAuthToken = new OAuthToken(); IsIntialized = false; }
public AsanaClient(IAsanaParameters parameters, IRestfulServiceClient client) { Parameters = parameters; OAuth = new AsanaOAuthService(client, Parameters); RestCommunicator = new AsanaCommunicatorService(OAuth, client); Tasks = new Tasks(RestCommunicator, Parameters); Projects = new Projects(RestCommunicator, Parameters); Stories = new Stories(RestCommunicator, Parameters); Users = new Users(RestCommunicator, Parameters); Workspaces = new Workspaces(RestCommunicator, Parameters); }
public Stories(IAsanaOAuthCommunicator client, IAsanaParameters asanaParams) { _restClient = client; _asanaParams = asanaParams; }
public AsanaOAuthBaseActivity(ICrateManager crateManager, IAsanaParameters parameters, IRestfulServiceClient client) : base(crateManager) { // :( i want dependancy injection here ↓ AClient = new AsanaClient(parameters, client); }
public Tasks(IAsanaOAuthCommunicator client, IAsanaParameters parameters) { _asanaParams = parameters; _restClient = client; }
public Get_Tasks_v1(ICrateManager crateManager, IRestfulServiceClient client, IAsanaParameters parameters) : base(crateManager, parameters, client) { DisableValidationOnFollowup = true; }
public Users(IAsanaOAuthCommunicator client, IAsanaParameters asanaParams) { _restfulClient = client; _asanaParams = asanaParams; }
public Post_Comment_v1(ICrateManager crateManager, IAsanaParameters parameters, IRestfulServiceClient client) : base(crateManager, parameters, client) { DisableValidationOnFollowup = true; }