Пример #1
0
 public ApiConnect(string TokenApi, string loginClient, string urlDirect, AccepLanguage accepLanguage)
 {
     UserRequest = new UserRequest
     {
         AccepLanguage = accepLanguage,
         loginClient   = loginClient,
         TokenApi      = TokenApi
     };
     UrlDirect = urlDirect;
 }
Пример #2
0
 public ApiConnect(string TokenApi, string loginClient, AccepLanguage accepLanguage)
 {
     UserRequest = new UserRequest
     {
         AccepLanguage = accepLanguage,
         loginClient   = loginClient,
         TokenApi      = TokenApi
     };
     UrlDirect = "api.direct.yandex.com";
 }
Пример #3
0
        public void constructorApiConnect4()
        {
            // Arrang

            AccepLanguage expected  = AccepLanguage.ru;
            string        expected1 = "Tester";
            string        expected2 = "10";
            string        expected3 = "api.direct.yandex.com";

            // Act
            API_Yandex_Direct.ApiConnect.ApiConnect apiConnect =
                new API_Yandex_Direct.ApiConnect.ApiConnect("10", "Tester", AccepLanguage.ru);

            // Assert
            Assert.AreEqual(expected, apiConnect.UserRequest.AccepLanguage);
            Assert.AreEqual(expected1, apiConnect.UserRequest.loginClient);
            Assert.AreEqual(expected2, apiConnect.UserRequest.TokenApi);
            Assert.AreEqual(expected3, apiConnect.UrlDirect);
        }
Пример #4
0
        public void constructorApiConnect2()
        {
            // Arrang
            UserRequest userRequest = new UserRequest
            {
                AccepLanguage = AccepLanguage.ru,
                loginClient   = "Tester",
                TokenApi      = "10"
            };

            AccepLanguage expected  = AccepLanguage.ru;
            string        expected1 = "Tester";
            string        expected2 = "10";
            string        expected3 = "api.direct1.yandex.com";

            // Act
            API_Yandex_Direct.ApiConnect.ApiConnect apiConnect = new API_Yandex_Direct.ApiConnect.ApiConnect(userRequest, "api.direct1.yandex.com");

            // Assert
            Assert.AreEqual(expected, apiConnect.UserRequest.AccepLanguage);
            Assert.AreEqual(expected1, apiConnect.UserRequest.loginClient);
            Assert.AreEqual(expected2, apiConnect.UserRequest.TokenApi);
            Assert.AreEqual(expected3, apiConnect.UrlDirect);
        }