public void Cleanup() { PropertyTypeHandlerMapper.Remove(typeof(float), false); PropertyTypeHandlerMapper.Remove(typeof(decimal), false); PropertyTypeHandlerMapper.Remove(typeof(DateTime), false); Database.Cleanup(); }
public void TestPropertyHandlerForDateTimeKindAsNullAtomic() { // Setup PropertyTypeHandlerMapper.Add(typeof(DateTime), new DateTimeToUtcKindHandler(), true); // Setup var models = CreateEntityModelForDateTimeKinds(10, true).AsList(); using (var connection = new SqlConnection(Database.ConnectionStringForRepoDb)) { // Act models.ForEach(e => connection.Insert(e)); // Act var result = connection.QueryAll <EntityModelForDateTimeKind>(); // Assert models.ForEach(e => { var item = result.First(obj => obj.Id == e.Id); Helper.AssertPropertiesEquality(e, item); }); } }
public void TestPropertyHandlerWithNumbersToLongHandlerAsNullAtomic() { // Setup PropertyTypeHandlerMapper.Add(typeof(decimal), new DecimalToLongTypeHandler(), true); // Setup var models = CreateEntityModelForNumberPropertiesToLongTypes(10, true).AsList(); using (var connection = new SqlConnection(Database.ConnectionStringForRepoDb)) { // Act models.ForEach(e => connection.Insert(e)); // Act var result = connection.QueryAll <EntityModelForNumberPropertiesToLongType>(); // Assert models.ForEach(e => { var item = result.First(obj => obj.Id == e.Id); Helper.AssertPropertiesEquality(e, item); }); } }