Tidy up Account and derived class's constructors

Get the account's id (renamed fron "name") from the account's config and
construct the id internally. Construct the ImapDB.Account instance
internally as well since it doesn't require any input from the engine.
This commit is contained in:
Michael Gratton 2018-11-18 23:18:21 +11:00 committed by Michael James Gratton
parent eb691ce7af
commit 41402c9108
10 changed files with 53 additions and 77 deletions

View file

@ -68,14 +68,10 @@ public class Geary.MockAccount : Account, MockObject {
}
public MockAccount(string name, AccountInformation information) {
base(name, information);
this._incoming = new MockClientService(
this.information, this.information.imap
);
this._outgoing = new MockClientService(
this.information, this.information.smtp
);
public MockAccount(AccountInformation config) {
base(config);
this._incoming = new MockClientService(config, config.imap);
this._outgoing = new MockClientService(config, config.smtp);
}
public override async void open_async(Cancellable? cancellable = null) throws Error {

View file

@ -34,7 +34,7 @@ class Geary.App.ConversationMonitorTest : TestCase {
new MockServiceInformation(),
new MockServiceInformation()
);
this.account = new MockAccount("test", this.account_info);
this.account = new MockAccount(this.account_info);
this.base_folder = new MockFolder(
this.account,
null,

View file

@ -75,7 +75,7 @@ public class Geary.ImapEngine.AccountProcessorTest : TestCase {
new MockServiceInformation(),
new MockServiceInformation()
);
this.account = new Geary.MockAccount("test-account", this.info);
this.account = new Geary.MockAccount(this.info);
this.succeeded = 0;
this.failed = 0;