LogViewer.FileWithPosition.FileNameMatch C# (CSharp) Method

FileNameMatch() public method

public FileNameMatch ( string otherFileName ) : bool
otherFileName string
return bool
        public bool FileNameMatch(string otherFileName)
        {
            return !string.IsNullOrEmpty(otherFileName) && Path.GetFullPath(otherFileName).Equals(Path.GetFullPath(this.FileName),
                StringComparison.InvariantCultureIgnoreCase);
        }

Usage Example

 public void FileNameMatch()
 {
     var file = new FileWithPosition(@"C:\Progra~1\someprogram\somelog.txt");
     Assert.That(file.FileNameMatch(@"C:\Program Files\someprogram\somelog.txt"));
 }