public async Task RestorePassword(string phone) { var result = await FNS.RestorePasswordAsync(phone); WriteOutput(result); Assert.IsTrue(result.IsSuccess); }
public async Task Login(string phone, string password) { var result = await FNS.LoginAsync(phone, password); WriteOutput(result); Assert.IsTrue(result.IsSuccess); }
public async Task Registration(string email, string name, string phone) { var result = await FNS.RegistrationAsync(email, name, phone); WriteOutput(result); Assert.IsTrue(result.IsSuccess); }
public async Task Registration(string email, string name, string phone) { var instance = new FNS(HttpMessageHandlerMock.GetHttpClient(System.Net.HttpStatusCode.NoContent, "")); var result = await instance.RegisterAsync(email, name, phone); Assert.IsTrue(result.IsSuccess); }
private async Task <bool> TrySignIn() { var phone = GetClearPhone(); if (string.IsNullOrWhiteSpace(phone) || string.IsNullOrWhiteSpace(Password)) { FailMessage = CommonMessages.UnfilledFields; return(false); } var task = FNS.LoginAsync(phone, Password); if (await TryExecute(task)) { var temp = JsonConvert.DeserializeObject <Sign>(task.Result.Message); Name = temp.Name; Email = temp.Email; IsAuthorization = true; await UpdateUserAccount(Sign); return(true); } return(false); }
public async Task Login(string phone, string password) { var instance = new FNS(HttpMessageHandlerMock.GetHttpClient( HttpStatusCode.OK, MockData.LoginSuccessResponse)); var result = await instance.LoginAsync(phone, password); Assert.IsTrue(result.IsSuccess); }
public async Task Receive(string fiscalNumber, string fiscalDocument, string fiscalSign, string phone, string password) { var result = await FNS.ReceiveAsync(fiscalNumber, fiscalDocument, fiscalSign, phone, password); WriteOutput(result); Assert.IsTrue(result.IsSuccess); }
public async Task Check(string fiscalNumber, string fiscalDocument, string fiscalSign, DateTime date, double sum) { var result = await FNS.VerifyAsync(fiscalNumber, fiscalDocument, fiscalSign, date, sum); WriteOutput(result); Assert.IsTrue(result.IsSuccess); }
public async Task RestorePassword(string phone) { var instance = new FNS(HttpMessageHandlerMock.GetHttpClient( System.Net.HttpStatusCode.NoContent, "")); var result = await instance.RestorePasswordAsync(phone); Assert.IsTrue(result.IsSuccess); }
public async Task ReceiveReceiptIsNotFound(string fiscalNumber, string fiscalDocument, string fiscalSign, string phone, string password) { var instance = new FNS(HttpMessageHandlerMock.GetHttpClient( HttpStatusCode.NotAcceptable, "")); var result = await instance.ReceiveAsync(fiscalNumber, fiscalDocument, fiscalSign, phone, password); Assert.AreEqual(HttpStatusCode.NotAcceptable, result.StatusCode); }
public async Task ReceiveReceiptUserIsNotFound(string fiscalNumber, string fiscalDocument, string fiscalSign, string phone, string password) { var instance = new FNS(HttpMessageHandlerMock.GetHttpClient( HttpStatusCode.Forbidden, "the user was not found or the specified password was not correct")); var result = await instance.ReceiveAsync(fiscalNumber, fiscalDocument, fiscalSign, phone, password); Assert.AreEqual(HttpStatusCode.Forbidden, result.StatusCode); }
public async Task CheckReceiptIsNotFound(string fiscalNumber, string fiscalDocument, string fiscalSign, DateTime date, decimal sum) { var instance = new FNS(HttpMessageHandlerMock.GetHttpClient( HttpStatusCode.NotAcceptable, "")); var result = await instance.CheckAsync(fiscalNumber, fiscalDocument, fiscalSign, date, sum); Assert.AreEqual(HttpStatusCode.NotAcceptable, result.StatusCode); }
public async Task Receive(string fiscalNumber, string fiscalDocument, string fiscalSign, string phone, string password) { var instance = new FNS(HttpMessageHandlerMock.GetHttpClient( HttpStatusCode.OK, MockData.ReceiveReceiptContent)); var result = await instance.ReceiveAsync(fiscalNumber, fiscalDocument, fiscalSign, phone, password); Assert.IsTrue(result.IsSuccess); }
public async Task CheckReceiptIsFound(string fiscalNumber, string fiscalDocument, string fiscalSign, DateTime date, decimal sum) { var instance = new FNS(HttpMessageHandlerMock.GetHttpClient( System.Net.HttpStatusCode.NoContent, "")); var result = await instance.CheckAsync(fiscalNumber, fiscalDocument, fiscalSign, date, sum); Assert.IsTrue(result.IsSuccess); }
public async Task <ReceiptResult> ReceiveAsync(string fiscalNumber, string fiscalDocument, string fiscalSign) { var user = await _UsersRepository.GetMainUserAsync(); if (user == null) { throw new FnsUserNotFoundException("Can't find user to authorize to FNS. Internal server problem. Check db."); } return(await FNS.ReceiveAsync(fiscalNumber, fiscalDocument, fiscalSign, user.Username, user.Password)); }
private async Task <bool> TryRestorePassword() { var phone = GetClearPhone(); if (string.IsNullOrWhiteSpace(phone)) { FailMessage = CommonMessages.UnfilledFields; return(false); } var task = FNS.RestorePasswordAsync(phone); return(await TryExecute(task)); }
private async Task <bool> TrySignUp() { var phone = GetClearPhone(); if (string.IsNullOrWhiteSpace(Email) || string.IsNullOrWhiteSpace(Name) || string.IsNullOrWhiteSpace(phone)) { FailMessage = CommonMessages.UnfilledFields; return(false); } var task = FNS.RegistrationAsync(Email, Name, phone); return(await TryExecute(task)); }
public Task <CheckResult> IsReceiptExists(string fiscalNumber, string fiscalDocument, string fiscalSign, DateTime date, decimal sum) { return(FNS.CheckAsync(fiscalNumber, fiscalDocument, fiscalSign, date, sum)); }
public async Task LoginToFns() { var login = await FNS.LoginAsync(_FnsUser.Username, _FnsUser.Password); Assert.That(login.IsSuccess, Is.EqualTo(true)); }