Exemple #1
0
        public void WhenSetAsTransferPublisherWithUnathorizedUser_ThenCheckResponse()
        {
            // Arrange
            using (SimpleServer.Create(TestHelpers.BaseUrl, Publisherandler))
            {
                var client = new YouScribeClient(TestHelpers.BaseUrl);

                var request = client.CreateAccountPublisherRequest();

                // Act
                bool ok = request.SetAsTransferPublisherAsync(new Models.Accounts.AccountPublisherTransferModel()).Result;

                // Assert
                Assert.False(ok);
                Assert.NotEmpty(request.Error.Messages);
                Assert.Contains("Not connected", request.Error.Messages.First());
            }
        }
        public void WhenSetAsTransferPublisherWithUnathorizedUser_ThenCheckResponse()
        {
            // Arrange
            using (SimpleServer.Create(TestHelpers.BaseUrl, Publisherandler))
            {
                var client = new YouScribeClient(TestHelpers.BaseUrl);

                var request = client.CreateAccountPublisherRequest();

                // Act
                bool ok = request.SetAsTransferPublisherAsync(new Models.Accounts.AccountPublisherTransferModel()).Result;

                // Assert
                Assert.False(ok);
                Assert.NotEmpty(request.Error.Messages);
                Assert.Contains("Not connected", request.Error.Messages.First());
            }
        }
Exemple #3
0
        public void WhenSetAsPaypalPublisher_ThenCheckResponse()
        {
            // Arrange
            using (SimpleServer.Create(TestHelpers.BaseUrl, Publisherandler))
            {
                var client = new YouScribeClient(TestHelpers.BaseUrl);
                client.AuthorizeAsync("test", "password").Wait();

                var request = client.CreateAccountPublisherRequest();

                // Act
                bool ok = request.SetAsPaypalPublisherAsync(new Models.Accounts.AccountPublisherPaypalModel()).Result;

                // Assert
                Assert.True(ok);
                Assert.Equal("{\"PaypalEmail\":null,\"IsProfessional\":false,\"CorporateName\":null,\"SiretNumber\":null,\"VATNumber\":null,\"Street\":null,\"Street2\":null,\"ZipCode\":null,\"State\":null,\"City\":null,\"CountryCode\":null,\"Civility\":0,\"FirstName\":null,\"LastName\":null,\"PhoneNumber\":null}", requestContent);
            }
        }
        public void WhenSetAsPaypalPublisher_ThenCheckResponse()
        {
            // Arrange
            using (SimpleServer.Create(TestHelpers.BaseUrl, Publisherandler))
            {
                var client = new YouScribeClient(TestHelpers.BaseUrl);
                client.AuthorizeAsync("test", "password").Wait();

                var request = client.CreateAccountPublisherRequest();

                // Act
                bool ok = request.SetAsPaypalPublisherAsync(new Models.Accounts.AccountPublisherPaypalModel()).Result;

                // Assert
                Assert.True(ok);
                Assert.Equal("{\"PaypalEmail\":null,\"IsProfessional\":false,\"CorporateName\":null,\"SiretNumber\":null,\"VATNumber\":null,\"Street\":null,\"Street2\":null,\"ZipCode\":null,\"State\":null,\"City\":null,\"CountryCode\":null,\"Civility\":0,\"FirstName\":null,\"LastName\":null,\"PhoneNumber\":null}", requestContent);
            }
        }