Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# unit test for throwing exception method

 [TestMethod]
        public void ShouldThrowExceptionIfDirectorNotExistWhenDeletingDir()
        {
            var folder1 = rootPath + @"unknowfolder";
            Assert.ThrowsException<Exception>(() => Util_Directory.DeleteDirectory(folder1));
        }
Source by fluentassertions.com #
 
PREVIOUS NEXT
Tagged: #unit #test #throwing #exception #method
ADD COMMENT
Topic
Name
8+7 =