Skip to content

Instantly share code, notes, and snippets.

@apathyboy
Created February 22, 2011 21:41
Show Gist options
  • Select an option

  • Save apathyboy/839473 to your computer and use it in GitHub Desktop.

Select an option

Save apathyboy/839473 to your computer and use it in GitHub Desktop.
/// When creating an instance of ServerDirectory with an invalid cluster name
/// an InvalidCluster exception is thrown.
TEST_F(ServerDirectoryTest, JoiningInvalidClusterThrowsException) {
auto datastore = make_shared<MockDatastore>();
EXPECT_CALL(*datastore, findClusterByName("bad_cluster"))
.WillOnce(Return(nullptr));
try {
ServerDirectory server_directory(datastore, "bad_cluster", "20050408-18:00");
FAIL() << "An exception should be thrown when given an invalid cluster name";
} catch(const InvalidClusterError& /*e*/) {
SUCCEED();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment