コード例 #1
0
        public void SuccessfulFetchConsentShould()
        {
            var s       = new TestScheduler();
            var account = AccountRecord();
            var repo    = Sellers(account.TraderaUser(id), true, s);

            var a = s.LetRun(() =>
                             Sut.FetchConsent(repo.Object, FetchCall(true), Seller));

            var r      = a.GetValues().Single();
            var record = ConsentRecord(account);

            Assert.IsTrue(Expected.Token == record.Token && Expected.Expires == record.Expires);
            repo.Verify(x => x.Commit(), Times.Once);
        }
コード例 #2
0
        public void AddTraderaUser()
        {
            var s       = new TestScheduler();
            var account = new Account {
                Id = AccountId
            };
            var repo = Repo(account, true, s);
            var soap = Soap(id);

            var a = s.LetRun(
                () => Sut.AddTraderaUser(repo.Object, soap.Object, TestIdentity, AccountId, Alias));

            var r        = a.GetValues().Single();
            var recorded = GetTraderaUser(account, id, Alias);

            Assert.IsTrue(r.ConsentId == recorded.Consent.Id);
            repo.Verify(x => x.Commit(), Times.Once);
        }