private void ValidateNonBlankId(string id, StringRenderable edgeOrVertex) { ThrowExceptionIfConditionTrue(id == null || id.Trim().Equals(""), "id value must not be empty", edgeOrVertex); }
private void ThrowExceptionIfConditionTrue(bool conditionFoExceptionToBeThrown, string exceptionMessagePrefix, StringRenderable edgeOrVertexOrWeight) { if (conditionFoExceptionToBeThrown) { string exceptionMessageSuffix = edgeOrVertexOrWeight == null ? "null" : edgeOrVertexOrWeight.RenderToString(); throw new GraphValidationException(exceptionMessagePrefix + " " + exceptionMessageSuffix); } }