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); }
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); }