Assert calls Fail method if the condition doesn't meet.
using System;
using System.Diagnostics;
using System.IO;
class Program
{
static void Main()
{
Trace.Listeners.Add(new TextWriterTraceListener("trace.txt"));
Trace.Assert(File.Exists("data.txt"), "File data.txt does not exist!");
}
}