Пример #1
0
        public void TestAddApp()
        {
            PlatformWS.PlatformServicesClient client = new PlatformWS.PlatformServicesClient();
            bool actual = false;

            PlatformWS.ModuleInfo model = new PlatformWS.ModuleInfo()
            {
                ModuleID       = Guid.NewGuid().ToString(),
                ModuleCode     = "13",
                ModuleIcon     = "无",
                ModuleName     = "SMT.EM.UI",
                UseState       = "1",
                ClientID       = "1.0.0.1000",
                Description    = "人力资源管理系统",
                EnterAssembly  = "SMT.EM.UI",
                ParentModuleID = "0",
                ModuleType     = "SMT.EM.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
                FileName       = "SMT.EM.UI.xap",
                FilePath       = "无",
                HostAddress    = "172.30.50.13",
                IsSave         = "1",
                ServerID       = "1.0.0.1000",
                Version        = "1.0.0.1000"
            };
            actual = client.AddModule(model);

            //异常:字段大小问题
            bool expected = true;

            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        public void TestAddAppByFile()
        {
            PlatformWS.PlatformServicesClient client = new PlatformWS.PlatformServicesClient();
            PlatformWS.ModuleInfo             model  = new PlatformWS.ModuleInfo()
            {
                ModuleID      = "AppID_Upload2",
                ModuleCode    = "AppCode_Upload2",
                ModuleIcon    = "AppIcon_Upload2",
                ModuleName    = "AppName_Upload2",
                UseState      = "1",
                ClientID      = "ClientID",
                Description   = "Description",
                EnterAssembly = "EnterAssembly",
                FileName      = "SMT_Upload2.xap",
                FilePath      = "FilePath",
                HostAddress   = "HostAddress",

                IsSave   = "1",
                ServerID = "ServerID",
                Version  = "Version"
            };
            bool   actual   = false;
            string filename = "SMT.xap";
            var    result   = client.GetModuleFileStream(filename);

            actual = client.AddModuleByFile(model, result);
            //异常:The underlying connection was closed: An unexpected error occurred on a receive
            //修改IIS上传文件大小限制和设置web.config的<httpRuntime executionTimeout="3600" maxRequestLength="2147483647" />

            bool expected = true;

            Assert.AreEqual(expected, actual);
        }
Пример #3
0
        public void TestRemoveShortCutByUser()
        {
            //ADMIN DAD32DB2-B07A-49b1-9710-61158D81B863
            PlatformWS.PlatformServicesClient client = new PlatformWS.PlatformServicesClient();
            bool actual = false;
            //ZWP 981f9458-471f-4865-9f27-682cae3f21d6
            //ADMIN DAD32DB2-B07A-49b1-9710-61158D81B863
            string userid = "DAD32DB2-B07A-49b1-9710-61158D81B863";

            bool result = client.RemoveShortCutByUser("BBDDFF0C-0E6C-4401-AA87-9FAD7E7BC07A", userid);

            actual = result;

            bool expected = true;

            Assert.AreEqual(expected, actual);
        }
Пример #4
0
        public void TestGetTaskByUser()
        {
            PlatformWS.PlatformServicesClient client = new PlatformWS.PlatformServicesClient();

            bool actual = false;
            //ZWP 981f9458-471f-4865-9f27-682cae3f21d6
            var userid = "981f9458-471f-4865-9f27-682cae3f21d6";
            var rst    = client.GetTaskConfigInfoByUser(userid);

            if (rst.Length > 0)
            {
                actual = true;
            }

            bool expected = true;

            Assert.AreEqual(expected, actual);
        }
Пример #5
0
        public void TestGetAppFileStream()
        {
            PlatformWS.PlatformServicesClient client = new PlatformWS.PlatformServicesClient();
            bool   actual   = false;
            string filename = "SMT.xap";
            var    result   = client.GetModuleFileStream(filename);

            if (result.Length > 0)
            {
                actual = true;
            }
            //异常1:修改maxReceivedMessageSize大小
            //异常2:maxReceivedMessageSize与maxBufferSize设置相等
            //异常3:修改maxArrayLength大小
            bool expected = true;

            Assert.AreEqual(expected, actual);
        }
Пример #6
0
        public void TestGetAppByCodes()
        {
            PlatformWS.PlatformServicesClient client = new PlatformWS.PlatformServicesClient();
            bool actual = false;

            string[] codes = new string[] { "0", "1" };

            var result = client.GetModuleByCodes(codes);

            if (result.Count() > 0)
            {
                actual = true;
            }

            bool expected = true;

            Assert.AreEqual(expected, actual);
        }
Пример #7
0
        public void TestAddAppList()
        {
            PlatformWS.PlatformServicesClient client = new PlatformWS.PlatformServicesClient();
            bool actual = false;
            List <PlatformWS.ModuleInfo> models = CreateTestDate();

            foreach (var itemModel in models)
            {
                actual = client.AddModule(itemModel);
            }
            //The socket connection was aborted.
            //This could be caused by an error processing your message or a receive timeout being exceeded by the remote host,
            //or an underlying network resource issue. Local socket timeout was '00:00:59.9840000'.
            //套接字连接中断,可能是由于消息处理错误,或者远程宿主接受超时引起,或者是底层网络资源问题导致,本地套接字时间是'00:00:59.7656250'。
            //修改:receiveTimeout="10:10:10"
            bool expected = true;

            Assert.AreEqual(expected, actual);
        }
Пример #8
0
        public void TestGetModuleCatalogByUser()
        {
            PlatformWS.PlatformServicesClient client = new PlatformWS.PlatformServicesClient();
            bool actual = false;
            //ZWP 981f9458-471f-4865-9f27-682cae3f21d6
            //ADMIN DAD32DB2-B07A-49b1-9710-61158D81B863
            //guojing c16f11e6-6020-479b-970f-484f5f308b7e
            string userid = "c16f11e6-6020-479b-970f-484f5f308b7e";

            var result = client.GetModuleCatalogByUser(userid);


            if (result.Count() > 0)
            {
                actual = true;
            }

            bool expected = true;

            Assert.AreEqual(expected, actual);
        }