chart controller test class. optimizing first two methods.