From d225fdecdd97ae86e14fd5db1114b9c82d7a27c3 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Mon, 22 Oct 2018 19:59:54 +0300 Subject: [PATCH] XmlModificationsTest moved to community --- .../intellij/xml/XmlModificationsTest.java | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 xml/tests/src/com/intellij/xml/XmlModificationsTest.java diff --git a/xml/tests/src/com/intellij/xml/XmlModificationsTest.java b/xml/tests/src/com/intellij/xml/XmlModificationsTest.java new file mode 100644 index 000000000000..4c647e73d416 --- /dev/null +++ b/xml/tests/src/com/intellij/xml/XmlModificationsTest.java @@ -0,0 +1,45 @@ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +package com.intellij.xml; + +import com.intellij.psi.XmlElementFactory; +import com.intellij.psi.xml.XmlTag; +import com.intellij.testFramework.PsiTestCase; + +public class XmlModificationsTest extends PsiTestCase { + private XmlElementFactory myFactory; + + @Override + protected void setUp() throws Exception { + super.setUp(); + myFactory = XmlElementFactory.getInstance(getProject()); + } + + @Override + public void tearDown() throws Exception { + myFactory = null; + + super.tearDown(); + } + + public void testAddAttribute1() { + final XmlTag tag = myFactory.createTagFromText(""); + tag.setAttribute("b", ""); + assertEquals("", tag.getText()); + tag.setAttribute("c", ""); + assertEquals("", tag.getText()); + } + + public void testAddAttribute2() { + final XmlTag tag = myFactory.createTagFromText(""); + tag.setAttribute("b", ""); + assertEquals("", tag.getText()); + tag.setAttribute("c", ""); + assertEquals("", tag.getText()); + } + + public void testAddSubTag1() { + final XmlTag tag = myFactory.createTagFromText(""); + tag.add(tag.createChildTag("b", "", null, false)); + assertEquals("", tag.getText()); + } +}