mirror of
https://github.com/github/codeql.git
synced 2026-02-28 21:03:50 +01:00
43 lines
997 B
C#
43 lines
997 B
C#
using System;
|
|
using System.Diagnostics;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
namespace Microsoft.VisualStudio.TestTools.UnitTesting
|
|
{
|
|
public static class Assert
|
|
{
|
|
public static void IsNull(object o) { }
|
|
public static void IsNotNull(object o) { }
|
|
public static void IsTrue(bool b) { }
|
|
public static void IsFalse(bool b) { }
|
|
}
|
|
}
|
|
|
|
class AssertTests
|
|
{
|
|
void Fn()
|
|
{
|
|
string s = null;
|
|
Debug.Assert(s != null);
|
|
Console.WriteLine(s.Length);
|
|
|
|
Assert.IsNull(s);
|
|
Console.WriteLine(s.Length); // always null
|
|
|
|
Assert.IsNotNull(s);
|
|
Console.WriteLine(s.Length);
|
|
|
|
Assert.IsTrue(s == null);
|
|
Console.WriteLine(s.Length); // always null
|
|
|
|
Assert.IsTrue(s != null);
|
|
Console.WriteLine(s.Length);
|
|
|
|
Assert.IsFalse(s != null);
|
|
Console.WriteLine(s.Length); // always null
|
|
|
|
Assert.IsFalse(s == null);
|
|
Console.WriteLine(s.Length);
|
|
}
|
|
}
|