Exemplo n.º 1
0
 protected virtual void RunButton_Click(object sender, EventArgs e)
 {
     var language = new LanguagesFactory().Create(PythonRadioButton.Text);
       var sharepointContext = new SharePointContext(SPContext.Current, language, new Console());
       language.Execute(ScriptTextBox.Text);
       ResultLabel.Text = sharepointContext.Message;
 }
Exemplo n.º 2
0
 private void repl_webpart_should_fire_python_scripts()
 {
     SPWeb web = Isolate.Fake.Instance<SPWeb>();
       SPContext context = Isolate.Fake.Instance<SPContext>();
       Isolate.WhenCalled(() => web.Title).WillReturn("Fake Title");
       Isolate.WhenCalled(() => context.Web).WillReturn(web);
       var language = new LanguagesFactory().Create("Python");
       var sharepointContext = new SharePointContext(context, language, new Console());
       language.Execute("Console.Write(__web__.Title)");
       Assert.AreEqual(sharepointContext.Message, web.Title);
 }