public void FileExistTestFromDB() { FileProcess fp = new FileProcess(); string fileName; bool expectedValue; bool causesException; bool fromCall; //Get values from data row fileName = TestContext.DataRow["FileName"].ToString(); expectedValue = Convert.ToBoolean(TestContext.DataRow["ExpectedValue"]); causesException = Convert.ToBoolean(TestContext.DataRow["CausesException"]); try { fromCall = fp.FileExist(fileName); Assert.AreEqual(expectedValue, fromCall, "File Name: " + fileName + " has failed it's existence test in test: FileExistsTestFromDB()"); } catch (AssertFailedException ex) { throw ex; } catch (ArgumentOutOfRangeException) { Assert.IsTrue(causesException); } }
public void FileNameDoesExistSimpleMessage() { FileProcess fp = new FileProcess(); bool fromCall; fromCall = fp.FileExist(_GoodFileName); Assert.IsFalse(fromCall, "File Does not Exist."); }
public void FileNameDoesNotExist() { FileProcess fp = new FileProcess(); bool fromCall; fromCall = fp.FileExist(BAD_FILE_NAME); Assert.IsFalse(fromCall); }
public void FileNameNullorEmpty_ThrowsArgumentNullException_UsingTryCatch() { FileProcess fp = new FileProcess(); try { fp.FileExist(""); } catch (ArgumentNullException) { return; } Assert.Fail("Call to FileExistts did not throw an ArgumentNullException"); }
//[Ignore()] public void FileNameDoesExist() { FileProcess fp = new FileProcess(); bool fromCall; //TestContext.WriteLine("Creating the file: " + _GoodFileName); TestContext.WriteLine("Testing the file: " + _GoodFileName); fromCall = fp.FileExist(_GoodFileName); //File.Delete(_GoodFileName); //TestContext.WriteLine("Deleting the file: " + _GoodFileName); Assert.IsTrue(fromCall); }
public void FileNameNullorEmpty_ThrowsArgumentNullException() { FileProcess fp = new FileProcess(); fp.FileExist(""); }