Created
February 22, 2011 21:41
-
-
Save apathyboy/839473 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// 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