I was doing some testing with nullable types, and it didn't work quite as I expected:
int? testInt = 0;
Type nullableType = typeof(int?);
Assert.AreEqual(nullableType, testInt.GetType()); // not the same type
My question is why does testInt.GetType() return int, and typeof(int?) return the true nullable type?
According to Enyra this should work. Guess what, it doesn't:
DateTime? test = new DateTime(434523452345);
Assert.IsTrue(test.GetType() == typeof(Nullable)); //FAIL
DateTime? test = new DateTime(434523452345);
Assert.IsTrue(test.GetType() == typeof(Nullable<>)); //STILL FAIL