public void EditorsTest() { var mock = new MainWindowMock(); var context = new CSharp.Context(); WindowObject.AttachToContext(context, mock); bool result = (bool)context.Execute("!!window.editors"); Assert.IsTrue(result); }
public void ExitTest() { var mock = new MainWindowMock(); var context = new CSharp.Context(); WindowObject.AttachToContext(context, mock); context.Execute("window.exit()"); Assert.AreEqual(mock.ExitCalled, 1); }
public void AddCommandTest() { var mock = new MainWindowMock(); var context = new CSharp.Context(); WindowObject.AttachToContext(context, mock); CommandObject.Attach(context); context.Execute("window.addCommand(new Command())"); Assert.AreEqual(mock.Commands.Count, 1); }
public void GetTitleTest() { var mock = new MainWindowMock(); var context = new CSharp.Context(); WindowObject.AttachToContext(context, mock); string title = "Test"; mock.Title = title; string result = context.Execute("window.getTitle()").ToString(); Assert.AreEqual(result, title); }
public void RemoveApplicationCommandTest() { var mock = new MainWindowMock(); var context = new CSharp.Context(); WindowObject.AttachToContext(context, mock); CommandObject.Attach(context); context.Execute(@" var c = new Command(); window.addApplicationCommand(c); window.removeApplicationCommand(c);"); Assert.AreEqual(mock.ApplicationCommands.Count, 0); }
public void SetTitleTest() { var mock = new MainWindowMock(); var context = new CSharp.Context(); WindowObject.AttachToContext(context, mock); context.Execute("window.setTitle(\"Test\")"); Assert.AreEqual(mock.Title, "Test"); }