Beispiel #1
0
        public void GetGreenCriteriaTest()
        {
            XmlRequestUtility xmlRequestUtility = new XmlRequestUtility(_elementsString);
            string            criterianToTest   = "customer='Happy Gilmore'";
            string            criterianTested   = "";

            criterianTested = xmlRequestUtility.GreenCriteria;
            Assert.AreEqual(criterianToTest, criterianTested);
        }
Beispiel #2
0
        public void GetRedCriterianTest()
        {
            XmlRequestUtility xmlRequestUtility = new XmlRequestUtility(_elementsString);
            string            criterianToTest   = "customer='Burt'";
            string            criterianTested   = "";

            criterianTested = xmlRequestUtility.RedCriteria;
            Assert.AreEqual(criterianToTest, criterianTested);
        }
Beispiel #3
0
        public void GetYellowCriteriaTest()
        {
            XmlRequestUtility xmlRequestUtility = new XmlRequestUtility(_elementsString);
            string            criterianToTest   = "customer='BobbyJoe'";
            string            criterianTested   = "";

            criterianTested = xmlRequestUtility.YellowCriteria;
            Assert.AreEqual(criterianToTest, criterianTested);
        }
Beispiel #4
0
        public void GetSqlParameters()
        {
            try
            {
                XmlRequestUtility xmlRequestUtility = new XmlRequestUtility(_elementsString);
                var parameterList = xmlRequestUtility.SqlParameters;

                Assert.AreEqual(4, parameterList.Count);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
        public DynamicSqlAccess(string xmlRequest)
        {
            XmlRequestUtility request = new XmlRequestUtility(xmlRequest);

            _requestConnection = new DatabaseConnectionInfo()
            {
                ServerName  = request.ServerName,
                CatalogName = request.CatalogName,
                Password    = request.Password,
                ServerType  = request.ServerType,
                UserName    = request.UserName
            };

            ConnectionFactory = () => new SqlConnection(CreateConnStr(_requestConnection));
        }
Beispiel #6
0
        public void GetServerNameTest()
        {
            try
            {
                XmlRequestUtility xmlRequestUtility = new XmlRequestUtility(_elementsString);
                string            serverNameToTest  = "sdisssql01";
                string            serverNameTested  = "";

                serverNameTested = xmlRequestUtility.ServerName;
                Assert.AreEqual(serverNameToTest, serverNameTested);
            }
            catch (Exception e)
            {
                Assert.AreEqual("ERROR 1 - Invalid Server Name", e.Message);
            }
        }
Beispiel #7
0
        public void GetPasswordTest()
        {
            try
            {
                XmlRequestUtility xmlRequestUtility = new XmlRequestUtility(_elementsString);
                string            passwordToTest    = "MyUiEmployerUser";
                string            passwordTested    = "";

                passwordTested = xmlRequestUtility.Password;
                Assert.AreEqual(passwordToTest, passwordTested);
            }
            catch (Exception e)
            {
                Assert.AreEqual("ERROR 4 - Invalid Password", e.Message);
            }
        }
Beispiel #8
0
        public void GetUserNameTest()
        {
            try
            {
                XmlRequestUtility xmlRequestUtility = new XmlRequestUtility(_elementsString);
                string            userNameToTest    = "MyUiEmployerUser";
                string            userNameTested    = "";

                userNameTested = xmlRequestUtility.UserName;
                Assert.AreEqual(userNameToTest, userNameTested);
            }
            catch (Exception e)
            {
                Assert.AreEqual("ERROR 3 - Invalid User Name", e.Message);
            }
        }
Beispiel #9
0
        public void GetCatalogNameTest()
        {
            try
            {
                XmlRequestUtility xmlRequestUtility = new XmlRequestUtility(_elementsString);
                string            catalogNameToTest = "MyUiEmployer";
                string            catalogNameTested = "";

                catalogNameTested = xmlRequestUtility.CatalogName;
                Assert.AreEqual(catalogNameToTest, catalogNameTested);
            }
            catch (Exception e)
            {
                Assert.AreEqual("ERROR 2 - Invalid Catalog Name", e.Message);
            }
        }