Esempio n. 1
0
        public void TestSearchOneDoc()
        {
            DMLogin.ServerName = DMProdEnvironment.Server;
            DMLogin.Password   = TestHelperSecure.MyPassword;

            // a known document in our library
            string expectedDocNum = "12387815";
            string expectedName   = "TEST 2";

            var info = new SearchInfo {
                SearchObject = "STANDARD_S",
                Criteria     = new Dictionary <string, string> {
                    { "DOCNUMBER", expectedDocNum }
                },
                ReturnProperties = new List <string> {
                    "DOCNUMBER", "DOCNAME"
                }
            };

            var search = new DMSearch()
            {
                Dst = DMLogin.Dst, Library = DMLogin.Library
            };
            var result = search.Search(info);

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Rows);
            Assert.AreEqual(1, result.Rows.Count);
            Assert.AreEqual(expectedDocNum, result.Rows[0][info.ReturnProperties[0]]);
            Assert.AreEqual(expectedName, result.Rows[0][info.ReturnProperties[1]]);
        }
Esempio n. 2
0
        public void TestSearchOneDoc()
        {
            DMLogin.ServerName = DMTestEnvironment.Server;
            DMLogin.UserName   = DMTestEnvironment.UserName;
            DMLogin.Password   = DMTestEnvironment.Password;

            // a known document in our library
            string expectedDocNum = "12387815";
            string expectedName   = "TEST 2";

            var info = new SearchInfo {
                SearchObject = "DR_LOAN_QBE",
                Criteria     = new Dictionary <string, string> {
                    { "CLIENT_ID", "222" }
                },
                ReturnProperties = new List <string> {
                    "%VERSION_ID",
                    "DOCNUMBER",
                    "DOCNAME",
                    "TYPE_ID",
                    "APPLICATION",
                    "AUDIT_NO",
                    "LAST_EDIT_DATE",
                    "LAST_EDIT_TIME"
                }
            };

            var search = new DMSearch()
            {
                DocumentSecurityToken = DMLogin.Dst, LibraryName = DMLogin.Library
            };
            var result = search.Search(info);

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Rows);
            Assert.AreEqual(1, result.Rows.Count);
            Assert.AreEqual(expectedDocNum, result.Rows[0][info.ReturnProperties[0]]);
            Assert.AreEqual(expectedName, result.Rows[0][info.ReturnProperties[1]]);
        }
Esempio n. 3
0
        public void TestSearchTwoDocs()
        {
            DMLogin.ServerName = DMProdEnvironment.Server;
            DMLogin.Password   = TestHelperSecure.MyPassword;

            // two known documents in our library
            string expectedDocNum  = "12387815";
            string expectedDocNum2 = "12418906";
            string expectedName    = "TEST 2";
            string expectedName2   = "DM TEST";

            var info = new SearchInfo {
                SearchObject = "STANDARD_S",
                Criteria     = new Dictionary <string, string> {
                    { "DOCNUMBER", expectedDocNum + "," + expectedDocNum2 }
                },
                OrderBy = new Dictionary <string, SortOrder> {
                    { "DOCNUMBER", SortOrder.Ascending }
                },
                ReturnProperties = new List <string> {
                    "DOCNUMBER", "DOCNAME"
                }
            };

            var search = new DMSearch()
            {
                Dst = DMLogin.Dst
            };
            var result = search.Search(info);

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Rows);
            Assert.AreEqual(2, result.Rows.Count);
            Assert.AreEqual(expectedDocNum, result.Rows[0][info.ReturnProperties[0]]);
            Assert.AreEqual(expectedName, result.Rows[0][info.ReturnProperties[1]]);
            Assert.AreEqual(expectedDocNum2, result.Rows[1][info.ReturnProperties[0]]);
            Assert.AreEqual(expectedName2, result.Rows[1][info.ReturnProperties[1]]);
        }
Esempio n. 4
0
        public void TestSearchOneDoc()
        {
            DMLogin.ServerName = DMProdEnvironment.Server;
            DMLogin.Password = TestHelperSecure.MyPassword;

            // a known document in our library
            string expectedDocNum = "12387815";
            string expectedName = "TEST 2";

            var info = new SearchInfo {
                SearchObject = "STANDARD_S",
                Criteria = new Dictionary<string, string> {
                    { "DOCNUMBER", expectedDocNum }
                },
                ReturnProperties = new List<string> {
                    "DOCNUMBER", "DOCNAME"
                }
            };

            var search = new DMSearch() { Dst = DMLogin.Dst, Library = DMLogin.Library };
            var result = search.Search(info);
            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Rows);
            Assert.AreEqual(1, result.Rows.Count);
            Assert.AreEqual(expectedDocNum, result.Rows[0][info.ReturnProperties[0]]);
            Assert.AreEqual(expectedName, result.Rows[0][info.ReturnProperties[1]]);
        }
Esempio n. 5
0
        public void TestSearchTwoDocs()
        {
            DMLogin.ServerName = DMProdEnvironment.Server;
            DMLogin.Password = TestHelperSecure.MyPassword;

            // two known documents in our library
            string expectedDocNum = "12387815";
            string expectedDocNum2 = "12418906";
            string expectedName = "TEST 2";
            string expectedName2 = "DM TEST";

            var info = new SearchInfo {
                SearchObject = "STANDARD_S",
                Criteria = new Dictionary<string, string> {
                    { "DOCNUMBER", expectedDocNum + "," + expectedDocNum2 }
                },
                OrderBy = new Dictionary<string, SortOrder> {
                    { "DOCNUMBER", SortOrder.Ascending }
                },
                ReturnProperties = new List<string> {
                    "DOCNUMBER", "DOCNAME"
                }
            };

            var search = new DMSearch() { Dst = DMLogin.Dst };
            var result = search.Search(info);
            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Rows);
            Assert.AreEqual(2, result.Rows.Count);
            Assert.AreEqual(expectedDocNum, result.Rows[0][info.ReturnProperties[0]]);
            Assert.AreEqual(expectedName, result.Rows[0][info.ReturnProperties[1]]);
            Assert.AreEqual(expectedDocNum2, result.Rows[1][info.ReturnProperties[0]]);
            Assert.AreEqual(expectedName2, result.Rows[1][info.ReturnProperties[1]]);
        }