Resources load to materials, how to?

Hello, I think is a simple question, but I don’t know nothing about it:

I have an created material in my materials folder, I just want to apply it to the GameObject by script.

I am trying

this.GetComponent<Renderer>().materials[0]=Resources.Load("Test", typeof(Material)) as Material;

The material name is Test and it is in materials folder, but the return is always the default material applied to the GameObject, so I think Unity didn’t found it.

C#?

In JS it works with:

var MatX = Resources.Load(“Material/Mat_X”, Material);

And:

this.gameObject.GetComponent(Renderer).material = MatX;

I use it that way successfully…