CSharp examples for Microsoft.VisualStudio.TestTools.UnitTesting:Assert
Assert Is Object Not Null
using System.Threading.Tasks; using System.Text; using System.Linq; using System.Collections.Generic; using System;/*from w w w .j a va 2s.c o m*/ public class Main{ public static void NotNull(object o, string name) { if (o == null) { name = name ?? "argument"; throw new ArgumentNullException(String.Format("{0} cannot be null", name)); } } }