function A()
{
    this.bar = 1;
    this.test_bar = 2;
    this.baz = [];
    this.test_baz = {};
}

A.prototype.foo = function()
{
    alert("foo");
}

A.prototype.test_foo = function()
{
    alert("test_foo");
}

A.prototype.boo = function()
{
    alert("boo");
}

A.prototype.test_boo = function()
{
    alert("test_boo");
}

function call_tests(obj)
{
    for (var name in obj)
    {
        var attr = obj[name];

        if (attr instanceof Function && name.indexOf("test_") == 0)
        {
            attr();
        }
    }
}

call_tests(new A());
