require File.dirname(__FILE__) + "/../test_helper" class MethodsTest < Test::Unit::TestCase should "be able to access Singletons through #instance" do assert ResourceGroupManager.respond_to?(:instance) assert MeshManager.respond_to?(:instance) assert MaterialManager.respond_to?(:instance) end should "have numerous bang (!) or query (?) methods" do assert Vector3.new.respond_to?(:normalise!) assert RenderWindow.instance_methods.include?("closed?") assert SubMesh.instance_methods.include?("is_mat_initialised?") end should "have certain methods" do assert FrameEvent.instance_methods.include?("time_since_last_frame") assert FrameEvent.instance_methods.include?("time_since_last_event") end should "be ignoring other methods for various reasons" do assert !AxisAlignedBox.new.respond_to?(:get_corner) assert !ResourceGroupManager.instance.respond_to?(:resource_exists) assert !BillboardChain.instance_methods.include?(:add_chain_element) assert !BillboardChain.instance_methods.include?(:update_chain_element) assert !BillboardChain.instance_methods.include?(:get_chain_element) assert !ConfigFile.instance_methods.include?(:load) assert !KeyFrame.instance_methods.include?(:get_post_reference_iterator) assert !Node.instance_methods.include?(:get_child_iterator) assert !Node.instance_methods.include?(:set_listener) assert !Node.instance_methods.include?(:get_listener) assert !ParticleSystem.instance_methods.include?(:_get_iterator) assert !Pass.instance_methods.include?(:set_hash_function) assert !Pass.instance_methods.include?(:get_hash_function) assert !PatchMesh.instance_methods.include?(:get_pose_iterator) assert !RenderQueue.instance_methods.include?(:set_renderable_listener) assert !RenderQueue.instance_methods.include?(:get_renderable_listener) assert !RenderSystem.instance_methods.include?(:add_listener) assert !RenderSystem.instance_methods.include?(:remove_listener) assert !RenderSystem.instance_methods.include?(:register_thread) assert !RenderSystem.instance_methods.include?(:unregister_thread) assert !SceneNode.instance_methods.include?(:get_attached_object_iterator) assert !TextureUnitState.instance_methods.include?(:add_effect) assert !TextureUnitState.instance_methods.include?(:remove_effect) assert !ManualObject.instance_methods.include?(:get_shadow_volume_renderable_iterator) end should "have fixed method names related to public instance variables of classes (method_fixes.rb)" do %w( use_shared_vertices? use_shared_vertices= vertex_data vertex_data= index_data index_data= ).each do |method| assert SubMesh.new.respond_to?(method) end %w( vertex_declaration vertex_declaration= vertex_buffer_binding vertex_buffer_binding= vertex_start vertex_start= vertex_count vertex_count= ).each do |method| assert VertexData.new.respond_to?(method) end %w( index_buffer index_buffer= index_start index_start= index_count index_count= ).each do |method| assert IndexData.new.respond_to?(method) end end end