public void AreNotSameTest() { FileProcess x = new FileProcess(); FileProcess y = new FileProcess(); Assert.AreNotSame(x, y); }
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 FileNameDoesNotExists() { FileProcess fp = new FileProcess(); bool fromCall; fromCall = fp.FileExists(@"C:\regedit.exe"); Assert.IsFalse(fromCall); }
public void FileNameExists() { FileProcess fp = new FileProcess(); bool fromCall; fromCall = fp.FileExists(@"C:\Windows\regedit.exe"); Assert.IsTrue(fromCall); }
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"); }
public void FileNameNullOrEmpty_ThrowsArgumentNullException_UsingTryCatch() { FileProcess fp = new FileProcess(); try { fp.FileExists(""); } catch (ArgumentException) { return; } Assert.Fail("Fail expected!!!"); }
//[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(""); }