Beispiel #1
0
        public void Given()
        {
            const string username = "******";
            const string password = "******";

            var data = new
            {
                StartIndex = 0,
                Count      = 0,
                TotalCount = 0
            };

            _pageSize   = 15;
            _pageNumber = 1;

            MockApi.SetEndpoint(new MockEndpoint(200, JsonConvert.SerializeObject(data), "application/json"));

            var optOutClient = new OptOutsService(MockApi.Url, new EsendexCredentials(username, password));

            _result  = optOutClient.GetAll(_pageNumber, _pageSize);
            _request = MockApi.LastRequest;
        }
        public void Given()
        {
            const string username = "******";
            const string password = "******";

            var data = new
            {
                StartIndex = 0,
                Count = 0,
                TotalCount = 0
            };

            _pageSize = 15;
            _pageNumber = 1;

            MockApi.SetEndpoint(new MockEndpoint(200, JsonConvert.SerializeObject(data), "application/json"));

            var optOutClient = new OptOutsService(MockApi.Url, new EsendexCredentials(username, password));

            _result = optOutClient.GetAll(_pageNumber, _pageSize);
            _request = MockApi.LastRequest;
        }
Beispiel #3
0
        public void Given()
        {
            const string username = "******";
            const string password = "******";

            _optOutId         = Guid.NewGuid();
            _receivedAt       = DateTime.UtcNow;
            _accountReference = "EX0123456";
            _phoneNumber      = "44123456789";

            var data = new
            {
                OptOuts = new[]
                {
                    new
                    {
                        Id               = _optOutId,
                        ReceivedAt       = _receivedAt,
                        AccountReference = _accountReference,
                        From             = new { PhoneNumber = _phoneNumber }
                    }
                },
                StartIndex = 0,
                Count      = 1,
                TotalCount = 1
            };

            _pageNumber = 1;
            _pageSize   = 15;

            MockApi.SetEndpoint(new MockEndpoint(200, JsonConvert.SerializeObject(data), "application/json"));

            var optOutClient = new OptOutsService(MockApi.Url, new EsendexCredentials(username, password));

            _result  = optOutClient.GetByPhoneNumber(_phoneNumber, _accountReference, _pageNumber, _pageSize);
            _request = MockApi.LastRequest;
        }
        public void Given()
        {
            const string username = "******";
            const string password = "******";

            _optOutId = Guid.NewGuid();
            _receivedAt = DateTime.UtcNow;
            _accountReference = "EX0123456";
            _phoneNumber = "44123456789";

            var data = new
            {
                OptOuts = new[]
                {
                    new
                    {
                        Id = _optOutId,
                        ReceivedAt = _receivedAt,
                        AccountReference = _accountReference,
                        From = new { PhoneNumber = _phoneNumber }
                    }
                },
                StartIndex = 0,
                Count = 1,
                TotalCount = 1
            };

            _pageNumber = 1;
            _pageSize = 15;

            MockApi.SetEndpoint(new MockEndpoint(200, JsonConvert.SerializeObject(data), "application/json"));

            var optOutClient = new OptOutsService(MockApi.Url, new EsendexCredentials(username, password));

            _result = optOutClient.GetByAccountReference(_accountReference, _pageNumber, _pageSize);
            _request = MockApi.LastRequest;
        }