agTestWriter code moved to class