Ejemplo n.º 1
0
            public void PutPersonalDataDateOfExpiryOfIdTest()
            {
                var client   = new FullPersonalDataModel().Init();
                var response = lykkeApi.PersonalData.PostPersonalData(client);

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

                var personalData  = client.PersonalDataModel();
                var newTime       = personalData.DateOfExpiryOfID.Value.AddDays(-1).AddMonths(-2).AddYears(-3).ToUniversalTime().ToString("MM/dd/yyyy");
                var changeRequest = new ChangeFieldRequest(newTime, personalData.Id);

                var putResponse = lykkeApi.PersonalData.PutPersonalDataDateOfExpiryOfId(changeRequest);

                var updatedClient = lykkeApi.PersonalData.GetPersonalDataById(personalData.Id).GetResponseObject();

                Assert.That(newTime, Is.EqualTo(updatedClient.DateOfExpiryOfID.Value.Date.ToString("MM/dd/yyyy")), "Unexpected DateOfBirth");
            }
Ejemplo n.º 2
0
            public void PutPersonalDataLastNameTest()
            {
                var client   = new FullPersonalDataModel().Init();
                var response = lykkeApi.PersonalData.PostPersonalData(client);

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

                var personalData = client.PersonalDataModel();
                var lastName     = TestData.GenerateString(6);

                var changeRequest = new ChangeFieldRequest(lastName, personalData.Id);
                var putResponse   = lykkeApi.PersonalData.PutPersonalDataLastName(changeRequest);

                var updatedClient = lykkeApi.PersonalData.GetPersonalDataById(personalData.Id).GetResponseObject();

                Assert.That(lastName, Is.EqualTo(updatedClient.LastName), "Unexpected Last name");
            }
Ejemplo n.º 3
0
            public void PutPersonalDataTest()
            {
                var client   = new FullPersonalDataModel().Init();
                var response = lykkeApi.PersonalData.PostPersonalData(client);

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

                var personalData = client.PersonalDataModel();

                personalData.Address = TestData.GenerateString(6);
                personalData.Email   = TestData.GenerateEmail();
                var putResponse = lykkeApi.PersonalData.PutPersonalData(personalData);

                var updatedClient = lykkeApi.PersonalData.GetPersonalDataById(personalData.Id).GetResponseObject();

                AreEqualByJson(personalData, updatedClient);
            }
Ejemplo n.º 4
0
            public void PutPersonalDataPhoneNumberTest()
            {
                var client   = new FullPersonalDataModel().Init();
                var response = lykkeApi.PersonalData.PostPersonalData(client);

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

                var personalData = client.PersonalDataModel();

                personalData.ContactPhone = TestData.GenerateString(8);
                var changeRequest = new ChangeFieldRequest(personalData.ContactPhone, personalData.Id);

                var putResponse = lykkeApi.PersonalData.PutPersonalDataPhoneNumber(changeRequest);

                var updatedClient = lykkeApi.PersonalData.GetPersonalDataById(personalData.Id).GetResponseObject();

                Assert.That(personalData.ContactPhone, Is.EqualTo(updatedClient.ContactPhone), "Unexpected ContactPhone");
            }
Ejemplo n.º 5
0
            public void PutPersonalDataAddressTest()
            {
                var client   = new FullPersonalDataModel().Init();
                var response = lykkeApi.PersonalData.PostPersonalData(client);

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

                var personalData = client.PersonalDataModel();

                personalData.Address = TestData.GenerateString(8);
                var changeRequest = new ChangeFieldRequest(personalData.Address, personalData.Id);

                var putResponse = lykkeApi.PersonalData.PutPersonalDataAddress(changeRequest);

                var updatedClient = lykkeApi.PersonalData.GetPersonalDataModelById(personalData.Id);

                Assert.That(personalData.Address, Is.EqualTo(updatedClient.Address), "Unexpected Address");
            }
Ejemplo n.º 6
0
            public void PostPagedIncludedOnlyTest()
            {
                int pagesNumber = 10;
                var client      = new FullPersonalDataModel().Init();
                var response    = lykkeApi.PersonalData.PostPersonalData(client);

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

                var page      = new PagingInfoModel(pagesNumber);
                var pageModel = lykkeApi.PersonalData.PostPage(page).GetResponseObject();

                var pagedRequestModel = new PagedRequestModel(new List <string>()
                {
                    client.Id
                }, pagesNumber);
                var includedPageModel = lykkeApi.PersonalData.PostPagedIncludedOnly(pagedRequestModel).GetResponseObject();

                Assert.That(includedPageModel.Result.Count, Is.EqualTo(1), "Unexpected result count");
                AreEqualByJson(client.PersonalDataModel(), includedPageModel.Result[0]);
            }