Assert Is True bool value - CSharp Microsoft.VisualStudio.TestTools.UnitTesting

CSharp examples for Microsoft.VisualStudio.TestTools.UnitTesting:Assert

Description

Assert Is True bool value

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*from   w  ww  .j a v  a 2  s. c o m*/

public class Main{
        public static void IsTrue(bool value, string name)
        {
            if (!value)
            {
                name = name ?? "argument";
                throw new ArgumentException(String.Format("{0} is not true", name));
            }
        }
}

Related Tutorials