Esempio n. 1
0
        public void TestSuccess()
        {
            User loggedUser = new User();
            User friend     = new User();

            friend.AddFriend(loggedUser);

            List <Wallet> wallets = new List <Wallet>();

            wallets.Add(new Wallet());
            wallets.Add(new Wallet());
            wallets.Add(new Wallet());

            IWalletDAO walletDao = Substitute.For <IWalletDAO>();

            walletDao.FindWalletsByUser(friend).Returns(wallets);

            IUserSession userSession = Substitute.For <IUserSession>();

            userSession.GetLoggedUser().Returns(loggedUser);

            WalletService service = new WalletService(userSession, walletDao);
            List <Wallet> result  = service.GetWalletsByUser(friend);

            Assert.IsNotNull(result);
            Assert.AreEqual(wallets.Count, result.Count);
        }
Esempio n. 2
0
 public WalletService()
 {
     walletDao   = new WalletDAO();
     userSession = UserSession.GetInstance()
 }
Esempio n. 3
0
 public WalletService(IUserSession userSession, IWalletDAO walletDao)
 {
     this.userSession = userSession;
     this.walletDao   = walletDao;
 }
Esempio n. 4
0
 public WalletService()
 {
     this.userSession = UserSession.GetInstance();
     this.walletDao   = new WalletDAO();
 }
Esempio n. 5
0
 public WalletService(IUserSession userSession, IWalletDAO walletDao)
 {
     _walletDao   = walletDao;
     _userSession = userSession;
 }
Esempio n. 6
0
 public WalletService(ILoggedUser IloggedUser, IWalletDAO IwalletDAO)
 {
     _ILoggedUser = IloggedUser;
     _IWalletDAO  = IwalletDAO;
 }
Esempio n. 7
0
 public WalletService(IWalletDAO walletDAO) => this.walletDAO = walletDAO;
Esempio n. 8
0
 public WalletService(IUserSession userSession, IWalletDAO walletDAO)
 {
     _userSession = userSession;
     _walletDAO   = walletDAO;
 }