Exemplo n.º 1
0
 public void DiaryControllerTest_Good()
 {
     ConfigureLogging();
     DiaryController dc = new DiaryController(Log, entryPath);
     if (dc == null)
         Assert.Fail();
     
     Assert.IsNotNull(dc.EntryFileFullName);
 }
Exemplo n.º 2
0
 public Form1(ILog log, DiaryController dc, int autoSaveInMinutes, bool hideUserNameColumn = true)
 {
     _log = log; //program level log file
     _dc = dc; //program level diary controller
     _hideUserNameColumn = hideUserNameColumn;
     InitializeComponent();
     ConfigureSysTray();
     ConfigureAutoSave(autoSaveInMinutes);
     ConfigureAutoComplete();
     dataGridView1.AutoGenerateColumns = false;
     LoadData();
 }
Exemplo n.º 3
0
        static void Main()
        {
            ConfigureLogging();
            ConfigureStartupOnLogon(ConfigurationManager.AppSettings["StartOnLogon"]);
            var autoSaveInMin = Convert.ToInt32(ConfigurationManager.AppSettings["AutoSave"]);
            var dc = new DiaryController(Log, ConfigurationManager.AppSettings["EntryPath"], ConfigurationManager.AppSettings["Sort"]);
            var hideUserColumn = bool.Parse(ConfigurationManager.AppSettings["HideUserNameColumn"]);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1(Log, dc, autoSaveInMin, hideUserColumn));
        }
Exemplo n.º 4
0
        public void DiaryControllerTest_BadFile()
        {
            ConfigureLogging();
            //var entryPath = "Z:\\test\\notthere";
            try
            {
                DiaryController dc = new DiaryController(null, null);
            }
            catch (Exception e)
            {
                Assert.IsTrue(e is Exception);
            }


        }
Exemplo n.º 5
0
        public void DiaryControllerTest_MissingEverything()
        {
            ConfigureLogging();
            try
            {
                DiaryController dc = new DiaryController(null, null);
            }
            catch (ArgumentNullException e)
            {
                Assert.IsTrue(e is ArgumentNullException);
            }

            catch (Exception e)
            {
                Assert.Fail("Exception was not caught.", e.Message);
            }
          
          

          
        }