package jetbrains.mps.baseLanguage.test;

/*Generated by MPS */

import jetbrains.mps.MPSLaunch;
import jetbrains.mps.lang.test.runtime.BaseTransformationTest;
import org.junit.jupiter.api.extension.RegisterExtension;
import jetbrains.mps.lang.test.runtime.TestParametersCacheExtension;
import jetbrains.mps.lang.test.runtime.TestParametersCache;
import org.junit.jupiter.api.Test;
import jetbrains.mps.lang.test.runtime.BaseTestBody;
import jetbrains.mps.lang.test.runtime.TransformationTest;
import jetbrains.mps.baseLanguage.behavior.AnonymousClass__BehaviorDescriptor;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import org.jetbrains.mps.openapi.language.SContainmentLink;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;

@MPSLaunch
public class AnonymousClassJavaName_Test extends BaseTransformationTest {
  @RegisterExtension
  private static final TestParametersCacheExtension ourParametersCacheExtension = new TestParametersCacheExtension(new TestParametersCache(AnonymousClassJavaName_Test.class, "${mps_home}", "r:00000000-0000-4000-0000-011c895902c7(jetbrains.mps.baseLanguage.test@tests)", false));

  public AnonymousClassJavaName_Test() {
    super(ourParametersCacheExtension.getParametersCache());
  }

  @Test
  public void test_testJavaNames() throws Throwable {
    new TestBody(this).test_testJavaNames();
  }

  /*package*/ static class TestBody extends BaseTestBody {

    /*package*/ TestBody(TransformationTest owner) {
      super(owner);
    }

    public void test_testJavaNames() throws Exception {
      runWithinCommand(() -> addNodeById("6649467621789725811"));
      runWithinCommand(() -> {
        assert AnonymousClass__BehaviorDescriptor.getJavaName_id2_jKYQ0K_an.invoke(SLinkOperations.getTarget(getNodeById("6649467621789782586"), LINKS.cls$Saf6)).endsWith("Foo$Bar$1");
        assert AnonymousClass__BehaviorDescriptor.getJavaName_id2_jKYQ0K_an.invoke(SLinkOperations.getTarget(getNodeById("6649467621789787135"), LINKS.cls$Saf6)).endsWith("Foo$Bar$2");
        assert AnonymousClass__BehaviorDescriptor.getJavaName_id2_jKYQ0K_an.invoke(SLinkOperations.getTarget(getNodeById("6649467621789793415"), LINKS.cls$Saf6)).endsWith("Foo$Bar$2$1");
        assert AnonymousClass__BehaviorDescriptor.getJavaName_id2_jKYQ0K_an.invoke(SLinkOperations.getTarget(getNodeById("6649467621789799984"), LINKS.cls$Saf6)).endsWith("Foo$Bar$2$2");
        assert AnonymousClass__BehaviorDescriptor.getJavaName_id2_jKYQ0K_an.invoke(SLinkOperations.getTarget(getNodeById("7102466869931833255"), LINKS.cls$Saf6)).endsWith("Foo$Bar$3$Baz$1");
      });
    }

  }

  private static final class LINKS {
    /*package*/ static final SContainmentLink cls$Saf6 = MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x1133e3b449aL, 0x1133e3b8b49L, "cls");
  }
}
