public void TestUpdateOneGlobalSmtpAdmin(Global global, GlobalValidServer server, GlobalValidPort port, Login login, Password password, SmtpEnableStartTls smtpEnableStartTls, SmtpSslCheckServerIdentity smtpSslCheckServerIdentity, SmtpSslOnConnect smtpSslOnConnect) { var handler = new DefaultManager(); var request = GenerateCreateGlobalRequest(global, server, port, login, password, smtpEnableStartTls, smtpSslCheckServerIdentity, smtpSslOnConnect); var response = handler.Send <CreateSmtpResponse>(SmtpEndPoint, JsonConvert.SerializeObject(request), HttpMethod.PUT); PrAssert.That(response, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.OK)); request["id"] = response.Result.Id; ReadAndVerifyData(request, UserInfo.Data["adminUserId"], UserInfo.Data["adminLogin"], UserInfo.Data["normalUserId"], UserInfo.Data["normalUserLogin"]); }
public void TestCreateOneGlobalSmtpNormalUser(Global global, GlobalValidServer server, GlobalValidPort port, Login login, Password password, SmtpEnableStartTls smtpEnableStartTls, SmtpSslCheckServerIdentity smtpSslCheckServerIdentity, SmtpSslOnConnect smtpSslOnConnect) { var request = GenerateCreateGlobalRequest(global, server, port, login, password, smtpEnableStartTls, smtpSslCheckServerIdentity, smtpSslOnConnect); var response = (new Common()).LoginAndSendRequestWithOtherAccount <object>(UserInfo.Data["companyName"], UserInfo.Data["normalUserLogin"], UserInfo.Data["normalUserPassword"], SmtpEndPoint, request); PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode((int)ResultCode.PermissionDenyCode)); }
public static Dictionary <string, object> GenerateCreateGlobalRequest(Global global, GlobalValidServer server, GlobalValidPort port, Login login, Password password, SmtpEnableStartTls smtpEnableStartTls, SmtpSslCheckServerIdentity smtpSslCheckServerIdentity, SmtpSslOnConnect smtpSslOnConnect) { var request = new Dictionary <string, object>(); GlobalMapperValue[global](request); ServerNameMapperValue[server](request); PortMapperValue[port](request); LoginMapperValue[login](request); PasswordMapperValue[password](request); SmtpEnableStartTlsMapperValue[smtpEnableStartTls](request); SmtpSslCheckServerIdentityMapperValue[smtpSslCheckServerIdentity](request); SmtpSslOnConnectMapperValue[smtpSslOnConnect](request); return(request); }