public void TestLoginUser()
        {
            ConnectionStringHelper.GetConnectionStrings();
            AccountService.AccountService serviceInstance = new AccountService.AccountService();
            DatabaseSmoObjectsAndSettings settings        = serviceInstance.AccountManager_Property.SmoSettings[AccountManager.CONNECTION_STRING_NAME];



            string username = "******";
            string password = "******";

            //check if user exists
            //bool exists = serviceInstance.DoesUsernameExist(username);


            //if exists delete user
            //if (exists)
            //{
            //    serviceInstance.AccountDeleteByCriteria(new Account(settings) { AccountUsername = username });
            //}

            //create user
            //exists = serviceInstance.DoesUsernameExist(username);
            //Assert.IsFalse(exists);

            //serviceInstance.AccountCreate(new Account(settings) { AccountUsername = username, AccountPassword = password });

            ////login user
            //exists = serviceInstance.DoesUsernameExist(username);
            //Assert.IsTrue(exists);

            bool login = serviceInstance.LoginUser(username, password);

            Assert.IsTrue(login);

            ////delete user
            //bool deleted = serviceInstance.AccountDeleteByCriteria(new Account(settings) { AccountUsername = username });
            //Assert.IsTrue(deleted);
        }
Example #2
0
        static void Main(string[] args)
        {
            List <Account.Account> accounts = new List <Account.Account>();

            IAccountService accountService = new AccountService.AccountService();

            accountService.CreateAccount(new Account.Account(111, "Alexandra", "Arkhipenko", 100m, 5, AccountType.Base));
            accountService.CreateAccount(new Account.Account(112, "Andrey", "Petrov", 1250m, 40, AccountType.Gold));
            accountService.CreateAccount(new Account.Account(113, "Galina", "Vizovik", 10245m, 120, AccountType.Premium));

            Print(accountService.GetAllAccounts());

            accountService.AddAmount(111, 500m);
            Print(accountService.GetAllAccounts());

            accountService.CloseAccount(112);
            Print(accountService.GetAllAccounts());

            accountService.DivAmount(113, 100m);
            Print(accountService.GetAllAccounts());

            Console.ReadKey();
        }
 //[TestMethod]
 public void TestAccountInstantiation()
 {
     AccountService.AccountService serviceInstance = new AccountService.AccountService();
 }