Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Bug Test Runner. Bug or not?

Discussion in 'Testing & Automation' started by alt3d, Nov 21, 2017.

  1. alt3d

    alt3d

    Joined:
    Aug 14, 2014
    Posts:
    4
    Why do this test succeed?
    I create two different gameObjects and take it transforms, why test think that are equals?

    [Test]
    public void TransformsTests()
    {
    var trnA = new GameObject("A").transform;
    var trnB = new GameObject("B").transform;
    Assert.AreEqual(trnA, trnB); // Not failed​
    }

    But if i change it, and take gameObjects instead transforms - it work fine and test failed.

    [Test]
    public void GameObjectsTests()
    {
    var goA = new GameObject("A");
    var goB = new GameObject("B");
    Assert.AreEqual(goA, goB); // Failed​
    }