public void GetDatabaseName_DatabaseName_ReturnsDatabaseName() { var nodeName = "TestDb"; var dbName = SimoHelper.GetDatabaseName(nodeName); Assert.AreEqual("TestDb", dbName); }
public void GetDatabaseName_FullCollectionName_ReturnsDatabaseName() { var nodeName = "TestDb.Persons"; var dbName = SimoHelper.GetDatabaseName(nodeName); Assert.AreEqual("TestDb", dbName); }
protected override void OnRequestSent() { var dbName = SimoHelper.GetDatabaseName(FullCollectionName); var cmd = new GetLastErrorCommand(Connection) { DatabaseName = dbName }; cmd.Execute(); if (cmd.Response.IsEmpty) { return; } var errMsg = MongoDbErrorMessage.FromDocument(cmd.Response.Documents[0]); if (errMsg == null) { return; } throw new SimoCommandException(ExceptionMessages.DatabaseCommand_CommandWasNotOk, errMsg); }