public void BuildApiUrlByMemberIdTest()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService_Accessor target = new LinkedInService_Accessor(authorization);
              string memberId = Constants.MemberId;
              string ResourceName = Constants.ResourceName;
              UriBuilder expected = new UriBuilder("http://api.linkedin.com/v1/people/id=12345/resource");

              UriBuilder actual = UriUtility.BuildApiUrlByMemberId(memberId, ResourceName);
              Assert.AreEqual(expected, actual);
        }
        public void GetCurrentUser_StandardProfileWithPublicField_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              List<ProfileField> profileFields = new List<ProfileField>
              {
            ProfileField.SitePublicProfileRequestUrl
              };

              target.GetCurrentUser(ProfileType.Standard, profileFields);
        }
        public void GetConnectionsForCurrentUser_ModifiedSinceOutOfRange_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              target.GetConnectionsForCurrentUser(new List<ProfileField>(), Modified.Updated, 0);
        }
        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&param2=value2");

              UriBuilder actual = UriUtility.BuildApiUrl(resources, parameters);
              Assert.AreEqual(expected, actual);
        }
        public void Search_ToLargeCount_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              Collection<ProfileField> profileFields = new Collection<ProfileField>
              {
            ProfileField.SitePublicProfileRequestUrl
              };

              int count = 26;

              target.Search(string.Empty, string.Empty, string.Empty, string.Empty, true, SortCriteria.Connections, 0, count, profileFields);
        }
        public void UnlikeNetworkUpdate_EmptyUpdateKeyParam_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              target.UnlikeNetworkUpdate(string.Empty);
        }
        public void CreateShare_NoCommentParam_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              target.CreateShare(null, VisibilityCode.ConnectionsOnly);
        }
 public void LinkedInServiceConstructorTest()
 {
     ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
       LinkedInService target = new LinkedInService(authorization);
 }
        public void CreateReShare_NoShareIdParam_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              target.CreateReShare(string.Empty, null, VisibilityCode.ConnectionsOnly);
        }
        public void CreateShare_EmptyCommentParamAndNoUriParam_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              target.CreateShare(string.Empty, Constants.ShareContent_One_Title, string.Empty, null, null, VisibilityCode.ConnectionsOnly, false);
        }
        public void CommentOnNetworkUpdate_ToLongCommentParam_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              target.CommentOnNetworkUpdate("update key", Constants.CreateShare_ToLongCommentParam);
        }
        public void CommentOnNetworkUpdate_NoCommentParam_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              target.CommentOnNetworkUpdate("update key", null);
        }
        public void CommentOnNetworkUpdate_EmptyUpdateKeyParam_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              target.CommentOnNetworkUpdate(string.Empty, null);
        }
        public void GetOutOfNetworkProfile_EmptyUrl_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              ApiRequest apiRequest = new ApiRequest
              {
            Url = string.Empty,
            Headers = new Collection<HttpHeader>()
              };

              target.GetOutOfNetworkProfile(apiRequest);
        }
        public void CreateShare_ToLongCommentParam_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              target.CreateShare(Constants.CreateShare_ToLongCommentParam, VisibilityCode.Anyone);
        }
        public void GetOutOfNetworkProfile_InvalidUrl_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              ApiRequest apiRequest = new ApiRequest
              {
            Url = "http:\\invalid.url",
            Headers = new Collection<HttpHeader>()
              };

              target.GetOutOfNetworkProfile(apiRequest);
        }
        public void CreateShare_ToLongTitleParam_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              target.CreateShare(string.Empty, Constants.CreateShare_ToLongTitleParam, string.Empty, new Uri(Constants.ShareContent_One_SubmittedUrl), null, VisibilityCode.ConnectionsOnly, false);
        }
        public void PostNetworkUpdate_NoBodyParam_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              target.PostNetworkUpdate(string.Empty, null);
        }
        public void CreateShare_UnknownVisibilityParam_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              target.CreateShare(string.Empty, VisibilityCode.Unknown);
        }
        public void SendRequestTest()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService_Accessor target = new LinkedInService_Accessor(authorization);
              WebRequest webRequest = WebRequest.Create(Constants.ApiBaseUrl);

              WebResponse actual = target.SendRequest(webRequest);
              Assert.IsNotNull(actual);
        }
        public void GetConnectionsByMemberId_ModifiedSinceOutOfRange_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              target.GetConnectionsByMemberId(Constants.MemberId, new List<ProfileField>(), 1, 10, Modified.Updated, 0);
        }
        public void UnlikeNetworkUpdate_NoUpdateKeyParam_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              target.UnlikeNetworkUpdate(null);
        }
        public void GetConnectionsForCurrentUser_IncludingPublicField_Test()
        {
            ILinkedInAuthorization authorization = new LinkedInAuthorizationMock();
              LinkedInService target = new LinkedInService(authorization);

              List<ProfileField> profileFields = new List<ProfileField>
              {
            ProfileField.SitePublicProfileRequestUrl
              };

              target.GetConnectionsForCurrentUser(profileFields, -1, -1);
        }
        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 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);
        }