Beispiel #1
0
        public void Id_TypesAndNamesSet()
        {
            var map = new SimpleObjectMap();

            AssertTypeOfPropertyIs(map.Identifiers, "Id", typeof(Int64));
            var id = map.Identifiers.First(x => x.Name == "Id");

            Assert.True(id.ReadOnly);
            Assert.False(id.Insert);
        }
Beispiel #2
0
        public void Properties_TypesAndNamesSet()
        {
            var map = new SimpleObjectMap();

            AssertTypeOfPropertyIs(map.Properties, "Long", typeof(Int64));
            AssertTypeOfPropertyIs(map.Properties, "SomeString", typeof(string));
            AssertTypeOfPropertyIs(map.Properties, "NullableLong", typeof(long?));
            AssertTypeOfPropertyIs(map.Properties, "Guid", typeof(Guid));
            AssertTypeOfPropertyIs(map.Properties, "NullableGuid", typeof(Guid?));
            AssertTypeOfPropertyIs(map.Properties, "IntBasedEnum", typeof(IntBasedEnum));
            AssertTypeOfPropertyIs(map.Properties, "NullableIntBasedEnum", typeof(IntBasedEnum?));
        }
Beispiel #3
0
        public void GetColumns_SimpleObject_ShouldContainSimpleObjectsMappedColumns()
        {
            var simpleObjectMap = new SimpleObjectMap();

            var columns = InsertHelper.GetColumns(simpleObjectMap);

            var columneNames = columns.Select(p => p.ColumnName);

            Assert.That(columneNames, Contains.Item("`LongColumnName`"));
            Assert.That(columneNames, Contains.Item("`SomeString`"));
            Assert.That(columneNames, Contains.Item("`NullableLong`"));
            Assert.That(columneNames, Contains.Item("`Guid`"));
            Assert.That(columneNames, Contains.Item("`NullableGuid`"));
            Assert.That(columneNames, Contains.Item("`IntBasedEnum`"));
            Assert.That(columneNames, Contains.Item("`NullableIntBasedEnum`"));
        }
Beispiel #4
0
        public void TableName_ReflectedProperly()
        {
            var map = new SimpleObjectMap();

            Assert.That(map.TableName, Is.EqualTo("`table_name`"));
        }