Beispiel #1
0
 public void loadTimesTest()
 {
     string file = string.Empty;
     CSVDAO target = new CSVDAO(file);
     target.FileHandler = new ManicTimeCSVMockFile();
     target.loadTimes();
     Assert.AreEqual(8, target.count);
     Assert.AreEqual("With Pat, regarding Schedule", target.getTimes()[7].description);
 }
Beispiel #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     var FD = new System.Windows.Forms.OpenFileDialog();
     if (FD.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         string fileToOpen = FD.FileName;
         CSVDAO list = new CSVDAO(FD.FileName);
         list.FileHandler = new WindowsFileHandler();
         list.loadTimes();
         _store.insert(list.getTimes());
         System.Windows.Forms.MessageBox.Show("Complete.");
     }
 }
Beispiel #3
0
 public void testEmptyConstructor()
 {
     string file = string.Empty;
     CSVDAO target = new CSVDAO(file);
     Assert.AreEqual(target.file, string.Empty);
 }
Beispiel #4
0
 public void testDefaultTimesContainer()
 {
     string file = string.Empty;
     CSVDAO target = new CSVDAO(file);
     Assert.AreEqual(target.getTimes().Count, 0);
 }
Beispiel #5
0
 public void testDefaultCount()
 {
     string file = string.Empty;
     CSVDAO target = new CSVDAO(file);
     Assert.AreEqual(0, target.count);
 }
Beispiel #6
0
 public void testConstructor()
 {
     string file = "C:\\Test.csv";
     CSVDAO target = new CSVDAO(file);
     Assert.AreEqual(target.file, file);
 }
Beispiel #7
0
        public void testFile()
        {
            string file = string.Empty; // TODO: Initialize to an appropriate value
            CSVDAO target = new CSVDAO(file); // TODO: Initialize to an appropriate value
            Assert.AreEqual(target.file, string.Empty);

            target.file = "SomeFile";
            Assert.AreEqual(target.file, "SomeFile");
        }
Beispiel #8
0
 public void testExecute()
 {
     string file = string.Empty;
     CSVDAO target = new CSVDAO(file);
     Assert.AreEqual(target.execute(), false);
 }