Assert

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!");
    }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.