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

            Assert.IsTrue(fromCall);
        }
Ejemplo n.º 2
0
        public void File_Name_Does_Exist()
        {
            _fromCall = _fileProcess.FileExists(FILE_EXIST);

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

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

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

            fp.FileExists("");
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 6
0
        public void FileNameDoesNotExist()
        {
            FileProcess fp            = new FileProcess();
            bool        fileDoesExist = fp.FileExists(BAD_FILE_NAME);

            Assert.IsFalse(fileDoesExist);
        }
Ejemplo n.º 7
0
        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);
            }
        }
Ejemplo n.º 8
0
        public void FileNameNullOrEmpty_ThrowsArgumentNullException()
        {
            FileProcess fp = new FileProcess();

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

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

            Assert.IsFalse(fromCall);
        }
Ejemplo n.º 11
0
        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("");
        }
Ejemplo n.º 13
0
        public void FileNameNullOrEmpty_UsingAttribute()
        {
            FileProcess fileProcess = new FileProcess();

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

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

            Assert.IsTrue(fileProcess.FileExists(fileName));
        }
Ejemplo n.º 16
0
        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
        }
Ejemplo n.º 18
0
        public void FileNameNullOrEmpty_UsingAttribute()
        {
            FileProcess fp = new FileProcess();

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

            fp.FileExists("");
        }
Ejemplo n.º 19
0
        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);
        }
Ejemplo n.º 21
0
        public void FileNameDoesNotExists()
        {
            FileProcess fileProcess = new FileProcess();

            bool result = fileProcess.FileExists(BAD_FILE_PATH);

            Assert.IsFalse(result);
        }
Ejemplo n.º 22
0
        public void FileNameExists_Bad()
        {
            TestContext.WriteLine("Executing FileNameExists_bad");

            FileProcess fileProcess = new FileProcess();

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

            //Assert
            fp.FileExists("");
        }
Ejemplo n.º 24
0
        public void FileNameNullOrEmpty_UsingAttribute()
        {
            FileProcess fp = new FileProcess();

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

            fp.FileExists("");
        }
Ejemplo n.º 25
0
        public void FileNameDoesExistSimpleMessageWithFormatting()
        {
            FileProcess fp = new FileProcess();
            bool        fromcall;

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

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

            var actual = fp.FileExists(_goodFileName);

            Assert.IsFalse(actual, "File '{0}' does not exist", _goodFileName);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 30
0
        public void FileNameDoeseNotExist()
        {
            FileProcess fp = new FileProcess();
            bool        fromCall;

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

            Assert.IsFalse(fromCall);
        }