public void innerViewBuildtest1() { InnerViewBuilder innerViewBuilder = new InnerViewBuilder("sub main\ncall main"); InnerView innerView = innerViewBuilder.Build(); bool actual = innerView.Functions.ContainsKey("main"); Assert.AreEqual(true, actual); CallInst inst = (CallInst)innerView.Functions["main"][0]; Assert.AreEqual("CALL", inst.Type.ToString()); }
public void innerViewBuildtest2() { InnerViewBuilder innerViewBuilder = new InnerViewBuilder("sub main\nset a 2"); InnerView innerView = innerViewBuilder.Build(); bool actual = innerView.Functions.ContainsKey("main"); Assert.AreEqual(true, actual); SetInst inst = (SetInst)innerView.Functions["main"][0]; Assert.AreEqual("SET", inst.Type.ToString()); }