public void AutomateTest() { var workPath = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath); var workConfiguration = new WorkConfiguration { ArchiveLocation = workPath, Name = "WpfTodo" }; CoreAppXmlConfiguration.Instance.WorkSessionLocation = new DirectoryInfo(workPath); using (var workSession = new WorkSession(workConfiguration, new NullWorkEnvironment())) { var screenRepository = workSession.Attach(Application); var mainWindow = screenRepository.Get <TodoWindow>("Wpf Todo", InitializeOption.NoCache); var newTaskScreen = mainWindow.NewTask(); const string title = "Write some tests"; newTaskScreen.Title = title; newTaskScreen.Description = "for White"; newTaskScreen.DueDate = DateTime.Now.AddDays(3); newTaskScreen.Create(); var tasks = mainWindow.Tasks.ToList(); Assert.That(tasks, Has.Count.EqualTo(1)); Assert.That(tasks[0].Title, Is.EqualTo(title)); } }
public void Automate() { var workConfiguration = new WorkConfiguration { ArchiveLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Name = "WpfTodo" }; using (var workSession = new WorkSession(workConfiguration, new NullWorkEnvironment())) { var screenRepository = workSession.Attach(Application); var mainWindow = screenRepository.Get <TodoWindow>("Wpf Todo", InitializeOption.NoCache); var newTaskScreen = mainWindow.NewTask(); const string title = "Write some tests"; newTaskScreen.Title = title; newTaskScreen.Description = "for White"; newTaskScreen.DueDate = DateTime.Now.AddDays(3); newTaskScreen.Create(); var tasks = mainWindow.Tasks.ToList(); Assert.Equal(1, tasks.Count); Assert.Equal(title, tasks[0].Title); } }
private void LaunchApplication(string auctionId) { var directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); var location = Path.Combine(directoryName, @"AuctionSniper.exe"); _app = Application.Launch(new ProcessStartInfo( location, auctionId)); var workConfiguration = new WorkConfiguration { ArchiveLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Name = "AuctionSniper" }; _workSession = new WorkSession(workConfiguration, new NullWorkEnvironment()); _screenRepository = _workSession.Attach(_app); }
public void createApplication() { var relPath = @"..\..\..\ConfigurableGUI\bin\Debug"; var currentPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); var fullPath = Path.Combine(currentPath, relPath); var appName = @"ConfigurableGUI.exe"; var markpadLocation = Path.Combine(fullPath, appName); Application Application = Application.Launch(markpadLocation); var workConfiguration = new WorkConfiguration { ArchiveLocation = fullPath, Name = "ConfigurableGUI" }; CoreAppXmlConfiguration.Instance.WorkSessionLocation = new DirectoryInfo(fullPath); theWorkSession = new WorkSession(workConfiguration, new NullWorkEnvironment()); theScreenRepo = theWorkSession.Attach(Application); }