package messages.sandbox.mA;

/*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 org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.lang.test.runtime.CheckExpectedMessageRunnable;
import jetbrains.mps.errors.MessageStatus;
import jetbrains.mps.project.ProjectBase;
import jetbrains.mps.smodel.SNodePointer;

@MPSLaunch
public class FeedbackRefOutOfScope_Test extends BaseTransformationTest {
  @RegisterExtension
  private static final TestParametersCacheExtension ourParametersCacheExtension = new TestParametersCacheExtension(new TestParametersCache(FeedbackRefOutOfScope_Test.class, "${mps_home}", "r:eb16dd70-ac3a-40ca-8c61-d7f237615dbf(messages.sandbox.mA@tests)", false));

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

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

  /*package*/ static class TestBody extends BaseTestBody {

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

    public void test_NodeErrorCheck7019192671317902489() throws Exception {

      runWithinCommand(() -> {
        SNode nodeToCheck = getRealNodeById("2802122285522027685");
        SNode operation = getRealNodeById("7019192671317902489");
        new CheckExpectedMessageRunnable.CheckAnyMessageRunnable(nodeToCheck, MessageStatus.ERROR, "Unresolved reference: B", myProject.getRepository(), ((ProjectBase) myProject).getPlatform()).run();
      });
    }
    public void test_NodeUnknownRuleCheck7019192671317924833() throws Exception {

      runWithinCommand(() -> {
        SNode nodeToCheck = getRealNodeById("7019192671317902494");
        SNode operation = getRealNodeById("7019192671317924833");
        new CheckExpectedMessageRunnable.CheckExpectedRuleMessageRunnable(nodeToCheck, MessageStatus.ERROR, new SNodePointer("r:5dbac061-aef9-4696-88ee-0f21fe5598f3(messages.customization.constraints)", "8918166317255507159"), "Reference is out of scope: can not found the link 'link' in the node A", myProject.getRepository(), ((ProjectBase) myProject).getPlatform()).run();
      });
    }

  }
}
