Exemplo n.º 1
0
        public void AreNotSameTest()
        {
            FileProcess x = new FileProcess();
            FileProcess y = new FileProcess();

            Assert.AreNotSame(x, y);
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        public void FileNameDoesExistSimpleMessage()
        {
            FileProcess fp = new FileProcess();
            bool        fromCall;

            fromCall = fp.FileExist(_GoodFileName);

            Assert.IsFalse(fromCall, "File Does not Exist.");
        }
Exemplo n.º 4
0
        public void FileNameDoesNotExists()
        {
            FileProcess fp = new FileProcess();
            bool        fromCall;

            fromCall = fp.FileExists(@"C:\regedit.exe");

            Assert.IsFalse(fromCall);
        }
Exemplo n.º 5
0
        public void FileNameExists()
        {
            FileProcess fp = new FileProcess();
            bool        fromCall;

            fromCall = fp.FileExists(@"C:\Windows\regedit.exe");

            Assert.IsTrue(fromCall);
        }
Exemplo n.º 6
0
        public void FileNameDoesNotExist()
        {
            FileProcess fp = new FileProcess();

            bool fromCall;

            fromCall = fp.FileExist(BAD_FILE_NAME);

            Assert.IsFalse(fromCall);
        }
Exemplo n.º 7
0
        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");
        }
Exemplo n.º 8
0
        public void FileNameNullOrEmpty_ThrowsArgumentNullException_UsingTryCatch()
        {
            FileProcess fp = new FileProcess();

            try
            {
                fp.FileExists("");
            }
            catch (ArgumentException)
            {
                return;
            }

            Assert.Fail("Fail expected!!!");
        }
Exemplo n.º 9
0
        //[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);
        }
Exemplo n.º 10
0
        public void FileNameNullorEmpty_ThrowsArgumentNullException()
        {
            FileProcess fp = new FileProcess();

            fp.FileExist("");
        }