public void Does_return_large_double_values(double value) { using (var db = OpenDbConnection()) { db.DropAndCreateTable <ModelWithDifferentNumTypes>(); var expected = new ModelWithDifferentNumTypes { Double = value }; var id = db.Insert(expected, true); var actual = db.SingleById <ModelWithDifferentNumTypes>(id); Assert.That(expected.Double, Is.EqualTo(actual.Double)); } }
public void Is_GetValue_Slow() { using (var db = OpenDbConnection()) { db.DropAndCreateTable <ModelWithDifferentNumTypes>(); 100.Times(x => db.Insert(ModelWithDifferentNumTypes.Create(x))); int count = 0; var sw = Stopwatch.StartNew(); 100.Times(i => count += db.Select <ModelWithDifferentNumTypes>().Count); sw.ElapsedMilliseconds.ToString().Print(); } }
public void Does_return_correct_numeric_values() { using (var db = OpenDbConnection()) { db.DropAndCreateTable <ModelWithDifferentNumTypes>(); var row = ModelWithDifferentNumTypes.Create(1); db.Insert(row); var fromDb = db.Select <ModelWithDifferentNumTypes>().First(); Assert.That(row.Short, Is.EqualTo(fromDb.Short)); Assert.That(row.Int, Is.EqualTo(fromDb.Int)); Assert.That(row.Long, Is.EqualTo(fromDb.Long)); Assert.That(row.Float, Is.EqualTo(fromDb.Float)); Assert.That(row.Double, Is.EqualTo(fromDb.Double)); Assert.That(row.Decimal, Is.EqualTo(fromDb.Decimal)); } }
public void Does_return_large_double_values(double value) { using (var db = OpenDbConnection()) { db.DropAndCreateTable<ModelWithDifferentNumTypes>(); var expected = new ModelWithDifferentNumTypes { Double = value }; var id = db.Insert(expected, true); var actual = db.SingleById<ModelWithDifferentNumTypes>(id); Assert.That(expected.Double, Is.EqualTo(actual.Double). Or.EqualTo(-9.9999999999999992E+124d). Or.EqualTo(9.9999999999999992E+124d)); //Firebird } }