public void Constructor_ThrowsException_OnNullDomain()
 {
     try
     {
         GetRequestStub request = new GetRequestStub("DevKey", null, "", "");
         Assert.Fail();
     }
     catch (ArgumentNullException ex)
     {
         Assert.IsInstanceOfType(ex, typeof(ArgumentNullException));
     }
 }
 public void Constructor_ThrowsException_OnNullDevKey()
 {
     try
     {
         GetRequestStub request = new GetRequestStub(null, "api.careerbuilder.com", "", "");
         Assert.Fail();
     }
     catch (ArgumentNullException ex)
     {
         Assert.IsInstanceOfType(ex, typeof(ArgumentNullException));
     }
 }
 public void BaseURL_ThrowsException_IfNotOverridden()
 {
     GetRequestStub request = new GetRequestStub("DevKey", "api.careerbuilder.com", "", "SiteID");
     try
     {
         string temp = request.BaseURL;
         Assert.Fail();
     }
     catch (NotImplementedException ex)
     {
         Assert.IsInstanceOfType(ex, typeof(NotImplementedException));
     }
 }
 public void Constructor_SetsSiteID()
 {
     GetRequestStub request = new GetRequestStub("DevKey", "api.careerbuilder.com", "", "SiteID");
     Assert.AreEqual("SiteID", request.SiteID);
 }
 public void Constructor_SetsCobrand()
 {
     GetRequestStub request = new GetRequestStub("DevKey", "api.careerbuilder.com", "cobrandcode", "");
     Assert.AreEqual("cobrandcode", request.CobrandCode);
 }
 public void Constructor_SetsDomain()
 {
     GetRequestStub request = new GetRequestStub("DevKey", "api.careerbuilder.com", "", "");
     Assert.AreEqual("api.careerbuilder.com", request.Domain);
 }
        public void BeforeRequest_SetsDevKey_AndDomain_AndCobrand_AndSiteID()
        {
            //Setup
            GetRequestStub request = new GetRequestStub("DevKey", "api.careerbuilder.com", "this is a cobrand", "this is a siteid");

            //Mock crap
            var restReq = new Mock<IRestRequest>();
            restReq.Setup(x => x.AddParameter("DeveloperKey", "DevKey"));
            restReq.Setup(x => x.AddParameter("CoBrand", "this is a cobrand"));
            restReq.Setup(x => x.AddParameter("SiteID", "this is a siteid"));

            var restClient = new Mock<IRestClient>();
            request.Request = restReq.Object;
            request.Client = restClient.Object;

            //Assert
            try
            {
                request.RunBeforeGet();
                Assert.Fail();
            }
            catch (NotImplementedException ex)
            {
                restReq.VerifyAll();
                Assert.IsInstanceOfType(ex, typeof(NotImplementedException));
            }

            
        }