Why does Assert.IsInstanceOfType(0.GetType(), typeof(int)) fail?

Change the call to the following

Assert.IsInstanceOfType(0, typeof(int));

The first parameter is the object being tested, not the type of the object being tested. by passing 0.GetType(), you were saying is “RunTimeType” an instance of System.int which is false. Under the covers thes call just resolves to

if (typeof(int).IsInstanceOfType(0))

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)