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

}
w__w__w__._j__a___v__a2_s_.___c_o__m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.