Example #1
0
        public void WhenFileNameDoesExistsShouldReturnTrue()
        {
            TestContext.WriteLine("Testing file: " + this.fullPath);
            bool fromCall = fileProcess.FileExists(fullPath);

            Assert.IsTrue(fromCall);
        }
        public void File_Name_Does_Exist()
        {
            _fromCall = _fileProcess.FileExists(FILE_EXIST);

            TestContext.WriteLine("Creating File: " + FILE_EXIST);

            Assert.IsTrue(_fromCall);
        }
Example #3
0
        public void FileProcessDoesNotExists()
        {
            var  fp       = new FileProcess();
            bool fromCall = fp.FileExists(@"C:\SteamSetup");

            Assert.IsFalse(fromCall);
        }
Example #4
0
        public void FileNameNullOrEmpty_ThrowsArgumentNullException()
        {
            // TODO;
            FileProcess fp = new FileProcess();

            fp.FileExists("");
        }
Example #5
0
        public void FileExistsTestFromDB()
        {
            FileProcess fp = new FileProcess();
            string      fileName;
            bool        expectedValue;
            bool        causesException;
            bool        fromCall;

            // Gets values from data row
            fileName        = TestContext.DataRow["FileName"].ToString();
            expectedValue   = Convert.ToBoolean(TestContext.DataRow["ExpectedValue"]);
            causesException = Convert.ToBoolean(TestContext.DataRow["CausesException"]);

            //Check assertions
            try
            {
                fromCall = fp.FileExists(fileName);
                Assert.AreEqual(expectedValue, fromCall,
                                "File Name: " + fileName +
                                " has failed it's existence test in test: FileExistsTestFromDB()");
            }
            catch (AssertFailedException ex)
            {
                throw ex;
            }
            catch (ArgumentNullException)
            {
                Assert.IsTrue(causesException);
            }
        }
Example #6
0
        public void FileNameDoesNotExist()
        {
            FileProcess fp            = new FileProcess();
            bool        fileDoesExist = fp.FileExists(BAD_FILE_NAME);

            Assert.IsFalse(fileDoesExist);
        }
        public void FileExistsTestFromDb()
        {
            FileProcess fp = new FileProcess();
            string      fileName;
            bool        expectedValue;
            bool        causesException;

            //get values from data row
            fileName        = TestContext.DataRow["FileName"].ToString();
            expectedValue   = Convert.ToBoolean(TestContext.DataRow["ExpectedValue"]);
            causesException = Convert.ToBoolean(TestContext.DataRow["CausesException"]);

            //check assertion
            try
            {
                var actual = fp.FileExists(fileName);
                Assert.AreEqual(expectedValue, actual, "File Name: " + fileName +
                                "doesn't seem to exist according to the code in test method: FileExistsTestFromDb()");
            }
            catch (AssertFailedException m)
            {
                //rethrow assertion
                throw m;
            }
            catch (ArgumentNullException)
            {
                // See if method was expected to throw an exception
                Assert.IsTrue(causesException);
            }
        }
Example #8
0
        public void FileNameNullOrEmpty_ThrowsArgumentNullException()
        {
            FileProcess fp = new FileProcess();

            fp.FileExists("");
            // Assert.Inconclusive();
        }
Example #9
0
        public void FileNameNullOrEmpty_ThrowArgumentException()
        {
            FileProcess fp = new FileProcess();
            bool        fromCall;

            fromCall = fp.FileExists("");
        }
Example #10
0
        public void FileNameDoesNotExist()
        {
            FileProcess fp       = new FileProcess();
            bool        fromCall = fp.FileExists(_BAD_FILE_NAME);

            Assert.IsFalse(fromCall);
        }
        public void FileNameDoesNotExists()
        {
            FileProcess fp       = new FileProcess();
            bool        fromCall = fp.FileExists(@"C:\Regedit.exe");

            Assert.IsFalse(fromCall);
        }
        public void FileNameNullOrEmpty_throwsArgumentNullException()   //Nome do meu arquivo nulo ou nao existe
        //Instancia um objeto fp de FileProcess
        {
            FileProcess fp = new FileProcess();

            fp.FileExists("");
        }
Example #13
0
        public void FileNameNullOrEmpty_UsingAttribute()
        {
            FileProcess fileProcess = new FileProcess();

            TestContext.WriteLine("checking null for fileName");
            fileProcess.FileExists("");
        }
        public void FilenameDoesNotExist()
        {
            FileProcess fileProcess = new FileProcess();

            TestContext.WriteLine("tttest.  ******************************** ");
            Assert.IsFalse(fileProcess.FileExists(BAD_FILENAME));
        }
        public void FilenameDoesExistUsingDeploymentItem()
        {
            FileProcess fileProcess = new FileProcess();
            string      fileName    = TestContext.DeploymentDirectory + @"\" + FILENAME;

            Assert.IsTrue(fileProcess.FileExists(fileName));
        }
        public void FilenameDoesExistSimpleMessage()
        {
            FileProcess fileProcess = new FileProcess();

            SetGoodFilename();
            Assert.IsFalse(fileProcess.FileExists(_GoodFilename), "Simple Message");
        }
        public void FileNameNullOrEmpty_ThrowsArgumentNullException()
        {
            FileProcess fp = new FileProcess();

            fp.FileExists("");

            // Refer rtf doc Your_first_unit_test_arrange_act_assert_1
        }
Example #18
0
        public void FileNameNullOrEmpty_UsingAttribute()
        {
            FileProcess fp = new FileProcess();

            TestContext.Write("Checking for a Null File");

            fp.FileExists("");
        }
        public void FileNameDoesExists()
        {
            //AAA Method
            FileProcess fp       = new FileProcess();                        //Arrange
            bool        fromCall = fp.FileExists(@"C:\Windows\Regedit.exe"); //Act

            Assert.IsTrue(fromCall);                                         //Assert
        }
        public void FileNameNullOrEmpty_ThrowsArgumentNullException()
        {
            FileProcess fileProcess = new FileProcess();

            Exception ex = Assert.Throws <ArgumentNullException>(() => fileProcess.FileExists(""));

            Assert.Equal("Value cannot be null.", ex.Message);
        }
Example #21
0
        public void FileNameDoesNotExists()
        {
            FileProcess fileProcess = new FileProcess();

            bool result = fileProcess.FileExists(BAD_FILE_PATH);

            Assert.IsFalse(result);
        }
Example #22
0
        public void FileNameExists_Bad()
        {
            TestContext.WriteLine("Executing FileNameExists_bad");

            FileProcess fileProcess = new FileProcess();

            Assert.IsFalse(fileProcess.FileExists(FILENAME_BAD));
        }
Example #23
0
        public void FileNameNullOrEmpty_UsingAttribute()
        {
            //Arrange
            FileProcess fp = new FileProcess();

            //Assert
            fp.FileExists("");
        }
Example #24
0
        public void FileNameNullOrEmpty_UsingAttribute()
        {
            FileProcess fp = new FileProcess();

            TestContext.WriteLine("Checking null or empty file ...");

            fp.FileExists("");
        }
        public void FileNameDoesExistSimpleMessageWithFormatting()
        {
            FileProcess fp = new FileProcess();
            bool        fromcall;

            fromcall = fp.FileExists(_GoodFileName);
            Assert.IsFalse(fromcall, "File {0} Does Not Exist", _GoodFileName);
        }
Example #26
0
        public void FileNameDoesNotExist()
        {
            FileProcess fp = new FileProcess();
            bool        fromCall;

            fromCall = fp.FileExists(@"c:\windows\badfilename.exe");
            Assert.IsFalse(fromCall);
        }
        public void FileNameDoesExistMessageWithFormatting()
        {
            FileProcess fp = new FileProcess();

            var actual = fp.FileExists(_goodFileName);

            Assert.IsFalse(actual, "File '{0}' does not exist", _goodFileName);
        }
Example #28
0
        public void FileNameDoesExists()
        {
            FileProcess fileProcess = new FileProcess();

            bool result = fileProcess.FileExists(@"C:\Windows\Regedit.exe");

            Assert.IsTrue(result);
        }
        public void FileNameNullOrEmpty_ThrowsArgumentNullException()
        {
            //Arrange
            var fileProcess = new FileProcess();

            //Act
            fileProcess.FileExists(string.Empty);
        }
Example #30
0
        public void FileNameDoeseNotExist()
        {
            FileProcess fp = new FileProcess();
            bool        fromCall;

            fromCall = fp.FileExists(@"C:\BadFileName.bad");

            Assert.IsFalse(fromCall);
        }