Cook the beans if using dry, by covering the beans with an inch of water, bringing it to a boil, covering and letting them cook until they are fork-tender but still holding their shape. This might take more than an hour, although the process would be much quicker in a pressure cooker. Drain and set aside.
Cook the bulgur by placing in a saucepan with 1 cup of water. Bring to a boil, cover, and lower the heat to a simmer. Let the bulgur cook for 15 minutes and turn off the heat.
Make the pesto by placing all of the pesto ingredients in a blender or food processor. Add a few tablespoons of water and process into a fairly smooth paste.
In a large bowl, mix the bulgur, beans, spinach, corn and pesto.
Add the mangoes, onion and tomatoes and stir to mix.
Serve warm or cold.