public void ParseTest1() { var target = new NuGetComponent(new Soba(), "."); Assert.Throws <SubtypeNotFoundException>(() => target.Eval("[NuGet NotRealSubtype.check]") ); }
public void GntRawTest1() { var target = new NuGetComponent(new Soba(), "."); Assert.Throws <PMLevelException>(() => target.Eval("[NuGet gnt.raw()]") ); Assert.ThrowsAny <Exception>(() => // should be any exception from gnt.core as normal behavior target.Eval("[NuGet gnt.raw(\"the is not a correct command\")]") ); }
public void GntTest1() { var target = new NuGetComponent(new Soba(), "."); Assert.Throws <IncorrectNodeException>(() => target.Eval("[NuGet gnt]") ); Assert.Throws <IncorrectNodeException>(() => target.Eval("[NuGet gnt()]") ); Assert.Throws <IncorrectNodeException>(() => target.Eval("[NuGet gnt.NotRealNode]") ); }
public void gntRawTest1() { var target = new NuGetComponent(); try { target.parse("[NuGet gnt.raw()]"); Assert.Fail("1"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(InvalidArgumentException), ex.GetType().ToString()); } try { target.parse("[NuGet gnt.raw(\"the is not a correct command\")]"); Assert.Fail("2"); } catch (System.Exception) { Assert.IsTrue(true); // should be any exception from gnt.core as normal behavior } }
public void gntTest1() { var target = new NuGetComponent(); try { target.parse("[NuGet gnt]"); Assert.Fail("1"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(IncorrectNodeException), ex.GetType().ToString()); } try { target.parse("[NuGet gnt()]"); Assert.Fail("2"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(IncorrectNodeException), ex.GetType().ToString()); } try { target.parse("[NuGet gnt.NotRealNode]"); Assert.Fail("3"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(IncorrectNodeException), ex.GetType().ToString()); } }
public static ISobaScript Configure(ISobaScript soba, IEnvironment env) { if (soba == null) { throw new ArgumentNullException(nameof(soba)); } IEncDetector detector = new EncDetector(); var fc = new FileComponent(soba, detector, new Exer(Settings.WPath, detector)); var zc = new SevenZipComponent(soba, new SzArchiver(), Settings.WPath); var nc = new NuGetComponent(soba, Settings.WPath); Settings._.WorkPathUpdated += (object sender, DataArgs <string> e) => { fc.Exer.BasePath = e.Data; zc.BasePath = e.Data; nc.BasePath = e.Data; }; //NOTE: custom order makes sense for vsSBE soba.Register(new TryComponent(soba)); soba.Register(new CommentComponent()); soba.Register(new BoxComponent(soba)); soba.Register(new ConditionComponent(soba)); soba.Register(new UserVariableComponent(soba)); soba.Register(new OwpComponent(soba, new OwpEnv(env))); soba.Register(new DteComponent(soba, new DteEnv(env))); soba.Register(new InternalComponent(soba, env, fc.Exer)); soba.Register(new EvMSBuildComponent(soba)); soba.Register(new BuildComponent(soba, new BuildEnv(env))); soba.Register(new FunctionComponent(soba)); soba.Register(fc); soba.Register(nc); soba.Register(zc); return(soba); }
public void parseTest1() { var target = new NuGetComponent(); target.parse("[NuGet NotRealSubtype.check]"); }