示例#1
0
        public void PythonScript_OnCompleted_works()
        {
            string               text    = @"
from SharpETL.Components import Element
def OnCompleted(a):
  yield Element(a.Id, a.Id, [])
";
            PythonScript         script  = new PythonScript("script", text, _pythonEngine);
            Mock <IScriptAction> maction = new Mock <IScriptAction>();

            maction.Setup(x => x.Id).Returns("ok");
            var result  = script.OnCompleted(maction.Object);
            var element = result.FirstOrDefault();

            Assert.IsNotNull(element);
            Assert.AreEqual("ok", element.Id);
            Assert.AreEqual("ok", element.Name);
        }