Tests average calculation