public void GetFileName_WithoutDirectory() { // Declare variables string input = @"notepad.exe"; string expectedOutput = "notepad.exe"; // Call method string output = Path.GetFileName(input); // Check result Assert.AreEqual(expectedOutput, output); }
public void GetFileName_EmptyInput() { ExceptionTester.CallMethodAndExpectException <ArgumentException>(() => Path.GetFileName(null)); ExceptionTester.CallMethodAndExpectException <ArgumentException>(() => Path.GetFileName(string.Empty)); }