public class Company { public string Name { get; set; } public Company() { Name = "The Name"; } } [TestFixture] public class NullTest { [Test] public void TestExtensionMethodFailWhenTheObjectIsNull() { Company company = new Company(); Assert.AreEqual(company.IsNullObj(), true); } } public static class Extension { public static bool IsNullObj(this Company obj) { return (obj == null); } }