public void Throws_If_Adding_Empty_File_Name(string fileName) { var dirBuilder = new DirectoryBuilder(Path.GetTempPath()); var exception = Assert.Throws <ArgumentException>(() => { dirBuilder.AddFile(fileName); }); Assert.Equal("fileName", exception.ParamName); Assert.Contains("File name can't be null or empty", exception.Message); exception = Assert.Throws <ArgumentException>(() => { dirBuilder.AddFile(fileName); }); Assert.Equal("fileName", exception.ParamName); Assert.Contains("File name can't be null or empty", exception.Message); }