public void AllPropertiesSetButRestEndpointIsEmpty()
        {
            FuelSDKConfigurationSection section = GetCustomConfigurationSectionFromConfigFile(allPropertiesSetButRestEndpointIsEmptyConfigFileName);
            var sectionWithDefaultRestEndpoint  = section.WithDefaultRestEndpoint(DefaultEndpoints.Rest);

            Assert.AreEqual(DefaultEndpoints.Rest, sectionWithDefaultRestEndpoint.RestEndPoint);
        }
Exemple #2
0
        public void BuilderAddsLegacyQueryParamWhenNoParamsArePresent()
        {
            FuelSDKConfigurationSection configSection = GetCustomConfigurationSectionFromConfigFile(authEndpointMissingLegacyQueryParamFileName);

            AuthEndpointUriBuilder builder = new AuthEndpointUriBuilder(configSection);
            var uri = builder.Build();

            Assert.AreEqual("https://authendpoint.com/v1/requestToken?legacy=1", uri);
        }
Exemple #3
0
        public void BuilderReturnsCorrectAuthEndpointUriWhenLegacyQueryIsPresentAlongwithOtherQueryParams()
        {
            FuelSDKConfigurationSection configSection = GetCustomConfigurationSectionFromConfigFile(authEndpointWithMultipleQueryParamsIncludingLegacyParamFileName);

            AuthEndpointUriBuilder builder = new AuthEndpointUriBuilder(configSection);
            var uri = builder.Build();

            Assert.AreEqual("https://authendpoint.com/v1/requestToken?param1=1&legacy=1", uri);
        }
 public void Setup()
 {
     client = new ETClient();
     config = new FuelSDKConfigurationSection();
     config.AuthorizationCode = "Auth_Code_For_OAuth2_WebApp";
     config.RedirectURI       = "www.google.com";
     config.ClientId          = "OAUTH2_CLIENTID";
     config.ClientSecret      = "OAUTH2_CLIENT_SECRET";
 }
        public void WithDefaultsDoesNotOverwriteValuesSetInConfig()
        {
            FuelSDKConfigurationSection section = GetCustomConfigurationSectionFromConfigFile(allPropertiesSetConfigFileName);

            section = section
                      .WithDefaultRestEndpoint(DefaultEndpoints.Rest)
                      .WithDefaultAuthEndpoint(DefaultEndpoints.Auth);

            Assert.AreEqual(section.AuthenticationEndPoint, "https://authendpoint.com");
            Assert.AreEqual(section.RestEndPoint, "https://restendpoint.com");
        }
        public void AllPropertiesSetInConfigSection()
        {
            FuelSDKConfigurationSection section = GetCustomConfigurationSectionFromConfigFile(allPropertiesSetConfigFileName);

            Assert.AreEqual(section.AppSignature, "none");
            Assert.AreEqual(section.ClientId, "abc");
            Assert.AreEqual(section.ClientSecret, "cde");
            Assert.AreEqual(section.SoapEndPoint, "https://soapendpoint.com");
            Assert.AreEqual(section.AuthenticationEndPoint, "https://authendpoint.com");
            Assert.AreEqual(section.RestEndPoint, "https://restendpoint.com");
        }
        public void NoCustomConfigSection()
        {
            FuelSDKConfigurationSection section = GetCustomConfigurationSectionFromConfigFile(emptyConfigFileName);

            Assert.IsNull(section);
        }
        public void MissingRestEndPointPropertyFromConfigSection()
        {
            FuelSDKConfigurationSection section = GetCustomConfigurationSectionFromConfigFile(requiredPropertiesOnlyConfigFileName);

            Assert.AreEqual(string.Empty, section.RestEndPoint);
        }