Inheritance: CBApi.Framework.Requests.UserRecommendationsRequest
        public void GetRecommendations_PerformsCorrectRequest()
        {
            //Setup
            var request = new UserReqStub("ExternalID", "DevKey", "api.careerbuilder.com", "", "");

            //Mock crap
            var response = new RestResponse<List<RecommendJobResult>> {Data = new List<RecommendJobResult>()};

            var restReq = new Mock<IRestRequest>();
            restReq.Setup(x => x.AddParameter("DeveloperKey", "DevKey"));
            restReq.Setup(x => x.AddParameter("ExternalID", "ExternalID"));
            restReq.SetupSet(x => x.RootElement = "RecommendJobResults");

            var restClient = new Mock<IRestClient>();
            restClient.SetupSet(x => x.BaseUrl = "https://api.careerbuilder.com/v1/recommendations/foruser");
            restClient.Setup(x => x.Execute<List<RecommendJobResult>>(It.IsAny<IRestRequest>())).Returns(response);

            request.Request = restReq.Object;
            request.Client = restClient.Object;

            //Assert
            List<RecommendJobResult> resp = request.GetRecommendations();
            restReq.VerifyAll();
            restClient.VerifyAll();
        }
        public void Constructor_ThrowsException_WhenPassedNullOrEmpty()
        {
            try
            {
                var request = new UserReqStub(null, "DevKey", "api.careerbuilder.com", "", "");
                Assert.Fail("Should have thrown exception");
            }
            catch (ArgumentNullException ex)
            {
                Assert.IsInstanceOfType(ex, typeof (ArgumentNullException));
            }

            try
            {
                var request2 = new UserReqStub("", "DevKey", "api.careerbuilder.com", "", "");
                Assert.Fail("Should have thrown exception");
            }
            catch (ArgumentNullException ex)
            {
                Assert.IsInstanceOfType(ex, typeof (ArgumentNullException));
            }
        }
 public void GetRequestURL_BuildsCorrectEndpointAddress()
 {
     var request = new UserReqStub("ExternalID", "DevKey", "api.careerbuilder.com", "", "");
     Assert.AreEqual("https://api.careerbuilder.com/v1/recommendations/foruser", request.RequestURL);
 }
 public void Constructor_SetsExternalID()
 {
     var request = new UserReqStub("ExternalID", "DevKey", "api.careerbuilder.com", "", "");
     Assert.AreEqual("ExternalID", request.ExternalID);
 }