public void Add_Boolean_Test() { QueryStringParameters target = new QueryStringParameters(); string name = string.Empty; bool value = false; target.Add(name, value); Assert.IsNotNull(target[name]); }
public void Add_Int_Test() { QueryStringParameters target = new QueryStringParameters(); string name = string.Empty; int value = 1; target.Add(name, value); Assert.IsNotNull(target[name]); }
public void Add_InvalidInt_Test() { QueryStringParameters target = new QueryStringParameters(); string name = Constants.QueryStringParam1; int value = -1; target.Add(name, value); Assert.IsNull(target[name]); }
public void Add_String_Test() { QueryStringParameters target = new QueryStringParameters(); string name = Constants.QueryStringParam1; string value = Constants.QueryStringValue1; target.Add(name, value); Assert.IsNotNull(target[name]); }
public void Add_InvalidString_Test() { QueryStringParameters target = new QueryStringParameters(); string name = Constants.QueryStringParam1; string value = string.Empty; target.Add(name, value); Assert.IsNull(target[name]); }
public void BuildApiUrlForCurrentUserTest() { ILinkedInAuthorization authorization = new LinkedInAuthorizationMock(); LinkedInService_Accessor target = new LinkedInService_Accessor(authorization); QueryStringParameters parameters = new QueryStringParameters(); parameters.Add(Constants.QueryStringParam1, Constants.QueryStringValue1); UriBuilder expected = new UriBuilder("http://api.linkedin.com/v1/people/~"); expected.Query = string.Format("{0}={1}", Constants.QueryStringParam1, Constants.QueryStringValue1); UriBuilder actual = UriUtility.BuildApiUrlForCurrentUser(parameters); Assert.AreEqual(expected, actual); }
public void BuildApiUrlTest() { ILinkedInAuthorization authorization = new LinkedInAuthorizationMock(); LinkedInService_Accessor target = new LinkedInService_Accessor(authorization); Collection<Resource> resources = new Collection<Resource>(); resources.Add(new Resource { Name = Constants.PeopleResourceName, Identifier = Constants.CurrentUserIdentifier }); resources.Add(new Resource { Name = Constants.ResourceName }); QueryStringParameters parameters = new QueryStringParameters(); parameters.Add(Constants.QueryStringParam1, Constants.QueryStringValue1); parameters.Add(Constants.QueryStringParam2, Constants.QueryStringValue2); UriBuilder expected = new UriBuilder("http://api.linkedin.com/v1/people/~/resource?param1=value1¶m2=value2"); UriBuilder actual = UriUtility.BuildApiUrl(resources, parameters); Assert.AreEqual(expected, actual); }
public void BuildApiUrlForMemberTest() { ILinkedInAuthorization authorization = new LinkedInAuthorizationMock(); LinkedInService_Accessor target = new LinkedInService_Accessor(authorization); string identifier = Constants.CurrentUserIdentifier; string resourceName = Constants.ResourceName; QueryStringParameters parameters = new QueryStringParameters(); UriBuilder expected = new UriBuilder("http://api.linkedin.com/v1/people/~/resource"); UriBuilder actual = UriUtility.BuildApiUrlForMember(identifier, resourceName, parameters); Assert.AreEqual(expected, actual); }