예제 #1
0
        public void WriteToFile_StringIsNull_ReturnsArgumentException()
        {
            //Arrange
            var    filePath = "sample.txt";
            string str      = "";

            //Act

            //Act => Assert
            Assert.ThrowsException <ArgumentException>(() => FileExtention.WriteToFile(filePath, str));
        }
예제 #2
0
        public void WriteToFile_FileDoesNotExists_ReturnsFileNotFoundException()
        {
            //Arrange
            var filePath = "sample_of_non_existing_file.txt";
            var str      = "Test string";

            //Act

            //Act => Assert
            Assert.ThrowsException <FileNotFoundException>(() => FileExtention.WriteToFile(filePath, str));
        }