Bu test neden başarısız oluyor?Garip Int64.Equals davranışı
[Test]
public void Int64Test()
{
Int64Keys ObjBigInt = new Int64Keys();
ObjBigInt.Id = 0;
PropertyInfo p = ObjBigInt.GetType().GetProperty("Id");
var IDValue = p.GetValue(ObjBigInt, null);
//var IDType = IDValue.GetType(); //returns {System.Int64}
Assert.IsTrue(IDValue.Equals(0)); //is returning false and the type if IDValue is Int64()
}
public class Int64Keys
{
public Int64 Id { get; set; }
}
public class Int32Keys
{
public Int32 Id { get; set; }
}
public class DoubleKeys
{
public double Id { get; set; }
}
Bunu düzeltmek için yeterli fikre kapılmasını referred bu soru değil.
Düzenleme: Repository desen kullanıyorum, örneğim herhangi bir türde olabilir (Int32, Int64, double).