MaterialTests CompareMaterials Method Delta Engine Documentation

Namespace: DeltaEngine.Tests.Content
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void CompareMaterials()
Examples

[Test]
public void CompareMaterials()
{
    var material2 = new Material(material.Shader, material.DiffuseMap);
    var shader3 =
        ContentLoader.Create<FakeShader>(new ShaderCreationData(ShaderFlags.Colored));
    var image3 = ContentLoader.Create<FakeImage>(new ImageCreationData(new Size(10)));
    var material3 = new Material(shader3, image3);
    Assert.AreEqual(material, material2);
    Assert.AreNotEqual(material2, material3);
    Assert.IsTrue(material2.Equals(material));
    Assert.IsFalse(material2.Equals(material3));
    Assert.AreEqual(material.GetHashCode(), material2.GetHashCode());
    Assert.IsTrue(material.Equals((object)material2));
}
See Also