public void CreateAccount() { Parse Fileobject = new Parse(); string configfile = Fileobject.FindFiles("*log4net.xml"); XmlConfigurator.Configure(Fileobject.LoadLog4netXmlDocument(configfile, Env, ApplicationID).DocumentElement); var log = LogManager.GetLogger(ApplicationID); log.Debug(string.Format("***** SERVICE INITIALIZED: {0} *****", ApplicationID)); SendFile envio = new SendFile(); Parse LeerJson = new Parse(); var urlocation = Fileobject.FindFiles("*Urls.json"); DirectoryofURL URlobject = (DirectoryofURL)LeerJson.FileRequest(urlocation, "file"); CreateNewAccount register = new CreateNewAccount(); Contacts contacto = new Contacts(); register = contacto.NewAccount(); string idusuario = null; bool retry = false; int i = 0; while (retry == false) { if (idusuario == null || idusuario.Contains("E_SYSTEM") || idusuario.Contains("E_AVIOS")) { register = null; register = contacto.NewAccount(); idusuario = envio.SendFiles(URlobject.URL[0].CreateAccount, register); if (i == 10) { retry = true; } i++; } else { if (i == 10) { retry = true; } i++; } } log.Info("The User ID created is: " + idusuario); Console.WriteLine("ID es:" + idusuario); log.Debug(string.Format("***** SERVICE FINALIZED: {0} *****", ApplicationID)); }
public void LoginExisting() { FileManager Fileobject = new FileManager(); string configfile = Fileobject.FindFiles("*log4net.xml"); XmlConfigurator.Configure(Fileobject.LoadLog4netXmlDocument(configfile, Env, ApplicationID).DocumentElement); var log = LogManager.GetLogger(ApplicationID); log.Debug(string.Format("***** SERVICE INITIALIZED: {0} *****", ApplicationID)); LoginRequest loginReqObj = new LoginRequest() { Username = "******", Password = "******", IP = "235.231.34.152", DeviceType = "WEB", Language = "es-ES", TokenID = "1f2df8d2-484d-4988-8dde-5d03e319520d", UserAgent = "Mozilla / 5.0(Windows NT 10.0; Win64; x64) AppleWebKit / 537.36(KHTML, like Gecko) Chrome / 64.0.3282.167 Safari / 537.36", Udid = "\"6979-5271-f146-5b16-421f-d63c\"" }; Parse LeerJson = new Parse(); DirectoryofURL fileURL; Object Empty; SendFile envio = new SendFile(); string filelocationURL = Fileobject.FindFiles("*Urls.json"); Empty = LeerJson.FileRequest(filelocationURL, "file"); fileURL = (DirectoryofURL)Empty; var urlocation = Fileobject.FindFiles("*Urls.json"); DirectoryofURL URlobject = (DirectoryofURL)LeerJson.FileRequest(urlocation, "file"); string login = envio.SendArchivo(fileURL.URL[0].Login, loginReqObj); var loginObject = JsonConvert.DeserializeObject <LoginResponse>(login); log.Info("El mail del usuario es:" + loginObject.MemberData.Email); Console.WriteLine("El login esperado es:" + loginObject.MemberData.Email); log.Info("El nombre del usuario es:" + loginObject.MemberData.FirstName); Console.WriteLine("El login esperado es:" + loginObject.MemberData.FirstName); }
public void LoginExisting() { string Env = "PRE"; Parse Fileobject = new Parse(); string configfile = Fileobject.FindFiles("*log4net.xml"); XmlConfigurator.Configure(Fileobject.LoadLog4netXmlDocument(configfile, Env, ApplicationID).DocumentElement); var log = LogManager.GetLogger(ApplicationID); log.Debug(string.Format("***** SERVICE INITIALIZED: {0} *****", ApplicationID)); LoginRequest loginReqObj = new LoginRequest() { Username = "******", Password = "******", IP = "235.231.34." + RandomGenerator.RandomString(3, 3), DeviceType = "WEB", Language = "es-ES", TokenID = RandomGenerator.RandomString(6, 3), Udid = "\"6979-5271-f146-5b16-421f-d63c\"" }; Parse LeerJson = new Parse(); DirectoryofURL fileURL; Object Empty; SendFile envio = new SendFile(); string filelocationURL = Fileobject.FindFiles("*Urls.json"); Empty = LeerJson.FileRequest(filelocationURL, "file"); fileURL = (DirectoryofURL)Empty; var urlocation = Fileobject.FindFiles("*Urls.json"); DirectoryofURL URlobject = (DirectoryofURL)LeerJson.FileRequest(urlocation, "file"); bool retry = false; string login = null; int i = 0; while (retry == false) { if (login == null || login.Contains("E_AVIOS") || login.Contains("E_SYSTEM")) { login = envio.SendFiles(fileURL.URL[0].Login, loginReqObj); if (i == 10) { retry = true; } i++; } else { retry = true; } } var loginObject = JsonConvert.DeserializeObject <LoginResponse>(login); log.Info("El mail del usuario es:" + loginObject.MemberData.Email); Console.WriteLine("El login esperado es:" + loginObject.MemberData.Email); log.Info("El nombre del usuario es:" + loginObject.MemberData.FirstName); Console.WriteLine("El login esperado es:" + loginObject.MemberData.FirstName); }