public void Initialize(IMongoCommand command, BsonDocument response) { if (_command != null || _response != null) { var message = string.Format("{0} has already been initialized.", this.GetType().Name); throw new InvalidOperationException(message); } _command = command; _response = response; } }
public void TestErrorMessagePresent() { var document = new BsonDocument("errmsg", "An error message"); var result = new CommandResult(); result.Initialize(document); Assert.AreEqual("An error message", result.ErrorMessage); }