public void SetUp()
 {
     AllureReport.GetInstance().CaseStarted(TestContext.CurrentContext.Test.FullName,
                                            TestContext.CurrentContext.Test.Name, "");
     lykkeApi     = new LykkeApi();
     apiSchemes   = new ApiSchemes();
     schemesError = new List <string>();
     TestContext.WriteLine("SetUp");
 }
            public void AccountExistInvalidEmailTest()
            {
                ApiSchemes apiSchemes = new ApiSchemes();

                string invalidEmail = TestData.GenerateEmail();

                var response = walletApi.AccountExist.GetAccountExistResponse(invalidEmail);

                Assert.That(response.StatusCode, Is.EqualTo(HttpStatusCode.OK), "Invalid status code");

                var obj = JObject.Parse(response.Content);

                ValidateScheme(obj.IsValid(apiSchemes.AccountExistSchemes.AuthResponseScheme, out schemesError), schemesError);

                var model = AccountExistModel.ConvertToAccountExistModel(response.Content);

                Assert.That(model.Result.IsEmailRegistered, Is.False, "Email is registered");
                Assert.That(model.Error, Is.Null, "Error is not null");
            }
Exemple #3
0
            public void SuccessAuthAfterRegistrationTest()
            {
                ApiSchemes apiSchemes = new ApiSchemes();

                AccountRegistrationModel newUser = new AccountRegistrationModel().GetTestModel();
                var response = walletApi.Registration.PostRegistrationResponse(newUser).GetResponseObject();

                Assert.That(response.Error, Is.Null, $"Error message not empty {response.Error?.Message}");

                AuthenticateModel auth = new AuthenticateModel(newUser);
                var authResponse       = walletApi.Auth.PostAuthResponse(auth);

                Assert.That(authResponse.StatusCode, Is.EqualTo(HttpStatusCode.OK), "Invalid status code");

                var obj = JObject.Parse(authResponse.Content);

                Assert.That(obj.IsValid(apiSchemes.AuthScheme.AuthResponseScheme), Is.True, "Responce JSON is not valid scheme");

                Assert.That(authResponse.GetResponseObject().Result.PersonalData.FullName, Is.EqualTo(newUser.FullName), "Invalid Full Name");
            }