With my “_texture” variable not set in the inspector, the first assert isn’t fired. Only the second one is. So for some reason IsNotNull doesn’t work for textures.
I tried “IsNotNull(null)” and that does work, so it seems to be a problem with textures.
Unity overrides the equality operator (==) for objects that derive from UnityEngine.Object. _texture has a reference to a C# object. That reference is real, and if you compare System.Object equality, by casting _texture to a System.Object, you will see that ((System.Object)_texture) == null is false.
However, the c# object that _texture references is a UnityEngine.Object. So _texture == null invokes the overloaded Unity equality check, which returns true because the internal engine counterpart to the c# object doesn’t exist for whatever internal reason.