Changes to action management

This commit is contained in:
AaronJamesY 2017-01-25 20:10:59 +00:00
parent 9a114e5583
commit 1b56b93422
4 changed files with 35 additions and 4 deletions

View file

@ -1,12 +1,23 @@
using System; using BankingBot.Contracts;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using BankingBot.Models;
namespace BankingBot.ActionManagers.AccountManagers namespace BankingBot.ActionManagers.AccountManagers
{ {
class AccountManager public class AccountManager : ActionManager, IAccountManager
{ {
public AccountManager(IBrowserBot browserBot)
: base(browserBot)
{
}
public IEnumerable<Account> GetAccounts()
{
throw new NotImplementedException();
}
} }
} }

View file

@ -51,6 +51,7 @@
<Compile Include="Attributes\ProviderIdentifier.cs" /> <Compile Include="Attributes\ProviderIdentifier.cs" />
<Compile Include="BrowserBot.cs" /> <Compile Include="BrowserBot.cs" />
<Compile Include="Client.cs" /> <Compile Include="Client.cs" />
<Compile Include="Contracts\IAccountManager.cs" />
<Compile Include="Contracts\IBrowserBot.cs" /> <Compile Include="Contracts\IBrowserBot.cs" />
<Compile Include="Contracts\IClient.cs" /> <Compile Include="Contracts\IClient.cs" />
<Compile Include="Contracts\ILoginCredentials.cs" /> <Compile Include="Contracts\ILoginCredentials.cs" />

View file

@ -7,6 +7,7 @@ using BankingBot.Contracts;
using BankingBot.ActionManagers.LoginManagers; using BankingBot.ActionManagers.LoginManagers;
using BankingBot.Models; using BankingBot.Models;
using OpenQA.Selenium; using OpenQA.Selenium;
using BankingBot.ActionManagers.AccountManagers;
namespace BankingBot namespace BankingBot
{ {
@ -15,6 +16,8 @@ namespace BankingBot
{ {
#region Dependencies #region Dependencies
private readonly ILoginManager _loginManager; private readonly ILoginManager _loginManager;
private readonly IAccountManager _accountManager;
protected readonly IBrowserBot BrowserBot; protected readonly IBrowserBot BrowserBot;
#endregion #endregion
@ -28,10 +31,12 @@ namespace BankingBot
public Client() public Client()
{ {
BrowserBot = new BrowserBot<T>(); BrowserBot = new BrowserBot<T>();
_loginManager = new LoginManager(BrowserBot); _loginManager = new LoginManager(BrowserBot);
_accountManager = new AccountManager(BrowserBot);
} }
#region Actions #region Actions - Login Manager
public void Login(ILoginCredentials credentials) public void Login(ILoginCredentials credentials)
{ {
@ -40,14 +45,18 @@ namespace BankingBot
LoginCredentials = credentials; LoginCredentials = credentials;
} }
#endregion
public decimal GetBalance() public decimal GetBalance()
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
#region Actions - Account Manager
public IEnumerable<Account> GetAccounts() public IEnumerable<Account> GetAccounts()
{ {
throw new NotImplementedException(); return _accountManager.GetAccounts();
} }
#endregion #endregion

View file

@ -0,0 +1,10 @@
using BankingBot.Models;
using System.Collections.Generic;
namespace BankingBot.Contracts
{
public interface IAccountManager
{
IEnumerable<Account> GetAccounts();
}
}