Esempio n. 1
0
        public void ThenTheResponseContainsNoErrors()
        {
            string responseContent = _endpointHelper.GetBills();
            GetBillListResponse billListResponse = JsonConvert.DeserializeObject <GetBillListResponse>(responseContent);

            Assert.IsFalse(billListResponse.HasError);
        }
        public void ThenTheResponseContainsAnErrorWithExpiredCode()
        {
            string responseContent = _endpointHelper.GetBills();
            GetBillListResponse billListResponse = JsonConvert.DeserializeObject <GetBillListResponse>(responseContent);

            Assert.IsTrue(billListResponse.HasError);
            Assert.IsTrue(billListResponse.Error.ErrorCode == ErrorCode.USER_SESSION_EXPIRED);
        }
        public void ThenTheResponseContainsAnErrorWithInvalidCredentialsCode()
        {
            string responseContent = _endpointHelper.GetBills();
            GetBillListResponse billListResponse = JsonConvert.DeserializeObject <GetBillListResponse>(responseContent);

            Assert.IsTrue(billListResponse.HasError);
            Assert.IsTrue(billListResponse.Error.ErrorCode == ErrorCode.SESSION_INVALID);
        }
        public void Initialize()
        {
            _fakeAccountHelper = new FakeAccountHelper();
            Guid validSessionId = _fakeAccountHelper.GenerateValidCredentials();

            _endpointHelper = new EndpointHelper();
            _endpointHelper.Setup()
            .SetAuthenticationToken(validSessionId.ToString());

            string responseContent = _endpointHelper.GetBills();

            _getBillListResponse = JsonConvert.DeserializeObject <GetBillListResponse>(responseContent);
        }
Esempio n. 5
0
        public void Initialize()
        {
            _fakeAccountHelper = new FakeAccountHelper();
            Guid validSessionId = _fakeAccountHelper.GenerateValidCredentials();

            _endpointHelper = new EndpointHelper();
            _billId         = _endpointHelper.Setup()
                              .SetAuthenticationToken(validSessionId.ToString())
                              .AddBill(typeof(WhenTheUserSuppliesAValidId).Name)
                              .ReturnAddedBillIds()[0];
            string responseContent = _endpointHelper.GetBills(_billId);

            _getBillListResponse = JsonConvert.DeserializeObject <GetBillListResponse>(responseContent);
        }