示例#1
0
 public void GetChildFileTest()
 {
     string name = baseStockTestName;
     BaseStock target = new BaseStock(name);
     string name1 = "File";
     BaseStock.Initializer func = delegate(FileStream s) { ++initializerFuncCounter; };
     FileStream actual;
     actual = target.GetChildFile(name1, func);
     Assert.AreEqual(actual.Name, appDataPath + "\\" + baseStockTestName + "\\" + name1, "DAMN! Returned FileStream has different name than it should.");
     Assert.IsTrue(initializerFuncCounter == 1, "DAMN! Initializer functions was not called.");
     actual.Close();
 }
示例#2
0
 public void GetChildFileTest1()
 {
     string name = baseStockTestName;
     BaseStock target = new BaseStock(name);
     string name1 = "File";
     FileStream actual;
     actual = target.GetChildFile(name1);
     Assert.AreEqual(appDataPath + "\\" + baseStockTestName + "\\" + name1, actual.Name, "DAMN! Returned FileStream has different name than it should.");
     actual.Close();
 }
示例#3
0
 public void DeleteChildFileTest()
 {
     string name = baseStockTestName;
     BaseStock target = new BaseStock(name);
     string name1 = "File";
     BaseStock.Initializer func = delegate(FileStream s) { ++initializerFuncCounter; };
     FileStream actual;
     actual = target.GetChildFile(name1);
     actual.Close();
     target.DeleteChildFile(name1);
     Assert.IsFalse(File.Exists(appDataPath + "\\" + baseStockTestName + "\\" + name1), "GOSH! Child file exist after deletion.");
 }