geary/test/engine/imap/command/imap-create-command-test.vala
Michael James Gratton ab9d0c27ad Make Imap.Command a top-level type rather than inherit from Parameter.
Instead, make the args property a parameter list, and add params to that.

This means Command's serialize method have a different signature compared
to Parameter's, letting us do some more interesting things with it.
2018-09-01 22:09:18 +10:00

34 lines
944 B
Vala

/*
* Copyright 2017 Michael Gratton <mike@vee.net>
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
*/
class Geary.Imap.CreateCommandTest : TestCase {
public CreateCommandTest() {
base("Geary.Imap.CreateCommandTest");
add_test("basic_create", basic_create);
add_test("special_use", special_use);
}
public void basic_create() throws Error {
assert_string(
"---- create owatagusiam/",
new CreateCommand(new MailboxSpecifier("owatagusiam/")).to_string()
);
}
public void special_use() throws Error {
assert_string(
"---- create Everything (use (\\All))",
new CreateCommand.special_use(
new MailboxSpecifier("Everything"),
SpecialFolderType.ALL_MAIL
).to_string()
);
}
}