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