예제 #1
0
        public void RenameEntityCorrectly()
        {
            // Arrange
            DCLBuilderInWorldEntity testEntity = new GameObject("_DCLBuilderInWorldEntity").AddComponent <DCLBuilderInWorldEntity>();

            testEntity.entityUniqueId = "testId";
            string testText = "Test text";
            DCLBuilderInWorldEntity retournedEntity = null;
            string retournedText = "";

            inspectorView.OnEntityRename += (entity, newName) =>
            {
                retournedEntity = entity;
                retournedText   = newName;
            };

            // Act
            inspectorView.EntityRename(testEntity, testText);

            // Assert
            Assert.AreEqual(testEntity.entityUniqueId, retournedEntity.entityUniqueId, "The entity does not match!!");
            Assert.AreEqual(testText, retournedText, "The text does not match!!");
        }
        public void RenameEntityCorrectly()
        {
            // Arrange
            BIWEntity testEntity = new BIWEntity();

            testEntity.entityUniqueId = "testId";
            string    testText        = "Test text";
            BIWEntity retournedEntity = null;
            string    retournedText   = "";

            inspectorView.OnEntityRename += (entity, newName) =>
            {
                retournedEntity = entity;
                retournedText   = newName;
            };

            // Act
            inspectorView.EntityRename(testEntity, testText);

            // Assert
            Assert.AreEqual(testEntity.entityUniqueId, retournedEntity.entityUniqueId, "The entity does not match!!");
            Assert.AreEqual(testText, retournedText, "The text does not match!!");
        }