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:
parent
eb691ce7af
commit
41402c9108
10 changed files with 53 additions and 77 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue