/*
 * Name:    ConsoleDebug 
 * Author:  Alexis
 * Blog:    http://www.cnblogs.com/alexis/
 * Time:    20101106
 * Place:   Shanghai
 **/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleDebug
{
    class Program
    {
        static void Main(string[] args)
        {
            Program p = new Program();
            p.SimpleDebug();
            p.ConditionDebug();
            p.MethodValue(2);
        }

        /// <summary>
        /// a simple example show how to debug
        /// </summary>
        private void SimpleDebug()
        {
            int a = 1;
            string s = "Hello World";
            s += a.ToString();
            DateTime now = DateTime.Now;

        }


        /// <summary>
        /// Condition Debug
        /// </summary>
        private void ConditionDebug()
        {
            for (int i = 0; i < 100; i++)
            {
                //we can use Assert 
                //System.Diagnostics.Debug.Assert(i != 50);
                if (i==50)
                {
                    //some error code here
                    Console.WriteLine("i=50 here");
                }
            }
        }

        int MethodValue(int a)
        {
            if (a==1)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
             
    }
}
