static void Main() { Task.Run(() => CheckForUpdate()); //if (CheckForUpdate()) //{ // //Do Not return as update exe need paremt process id // //return; //} // AppDomain currentDomain = AppDomain.CurrentDomain; Application.ThreadException += Application_ThreadException1; AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler); Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); AddRuntimeSetings(); IWindsorContainer windsorContainer = new WindsorContainer(); CastleWireUp.WireUp(windsorContainer); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var mainForm = (Form)windsorContainer.Resolve <IMainForm>(); ((IMainForm)mainForm).VersionNumber = GetVersionNumber(); Application.Run(mainForm); }
#pragma warning restore CS0618 // 'TestFixtureSetUpAttribute' is obsolete: 'Use OneTimeSetUpAttribute' public void SetUp() { string excelDownloadFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Progress Tracking.xlsx"); var statusDate = DateTime.Parse("10/13/2016"); var testExcelFilePath = ConfigurationManager.AppSettings["ExcelDownloadFilePath"]; if (File.Exists(excelDownloadFilePath)) { File.Delete(excelDownloadFilePath); } File.Copy(testExcelFilePath, excelDownloadFilePath); IWindsorContainer windsorContainer = new WindsorContainer(); CastleWireUp.WireUp(windsorContainer); var statusGenerator = windsorContainer.Resolve <IStatusGenerator>(); var statusHTML = statusGenerator.GenerateStatusForSingleDay(statusDate, string.Empty, true); var htmlFilePath = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "statusHtml.html"); File.WriteAllText(htmlFilePath, statusHTML); driver = new ChromeDriver(); driver.Navigate().GoToUrl("file://" + htmlFilePath); }
protected void BaseSetUp(bool validate) { _oldbConnection = Mock.Create <IOLDBConnection>(); _dataRow = this.GetDataRows(); Mock.Arrange(() => _oldbConnection.GetInProgessRowsExcludingRegression(Arg.IsAny <DateTime>(), string.Empty)) .Returns(new[] { _dataRow }).OccursOnce(); _windsorContainer = new WindsorContainer(); _windsorContainer.Register(Component.For <IOutPutGenerator>().ImplementedBy <XMLOutPutGenerator>()); CastleWireUp.WireUp(_windsorContainer); InProgess inProgess = new InProgess(_windsorContainer.Resolve <ISectionHelper>(), _oldbConnection); var xml = inProgess.GetItmesAsHtml(DateTime.Now, string.Empty, validate); _xdoc = XDocument.Parse(xml); }