Beispiel #1
0
        public void GetPropertyPath()
        {
            // ARRANGE
            var classSpecifics = ClassSpecifics.Of <ClassSpecificsTest>();

            // ACT
            var propertyDisplayName = classSpecifics.GetPropertyPath(test => test.Property2);

            // ASSERT
            Assert.That(propertyDisplayName, Is.EqualTo("Property2"));
        }
Beispiel #2
0
        public void GetPropertyInfo()
        {
            // ARRANGE
            var classSpecifics = ClassSpecifics.Of <ClassSpecificsTest>();

            // ACT
            var propertyDisplayName = classSpecifics.GetPropertyInfo(test => test.Property2);

            // ASSERT
            Assert.That(propertyDisplayName, Is.Not.Null);
        }
Beispiel #3
0
        public void GetPropertyDisplayNameForPropertyWithoutDisplayAttribute()
        {
            // ARRANGE
            var classSpecifics = ClassSpecifics.Of <ClassSpecificsTest>();

            // ACT
            var propertyDisplayName = classSpecifics.GetPropertyDisplayName(test => test.Property1);

            // ASSERT
            Assert.That(propertyDisplayName, Is.Null);
        }
Beispiel #4
0
        public void Off()
        {
            // ARRANGE
            var type = this.GetType();

            // ACT
            var assemblyeSpecifics = ClassSpecifics.Of(type);

            // ASSERT
            Assert.That(assemblyeSpecifics, Is.Not.Null);
        }
Beispiel #5
0
        public void GetField()
        {
            // ARRANGE
            var someClass = ClassSpecifics.Of <SomeClass>();

            // ACT
            var field = someClass.GetFieldInfo(SomeClass.Field1Name);

            // ASSERT
            Assert.That(field, Is.Not.Null);
        }
Beispiel #6
0
        public static string GetIndexName <TEntity>([NotNull] Expression <Func <TEntity, object> > property)
        {
            Fail.IfArgumentNull(property, nameof(property));

            ClassSpecifics.Concrete <TEntity> entityType = ClassSpecifics.Of <TEntity>();
            string entityName   = entityType.GetClassName();
            var    propertyName = entityType.GetPropertyName(property);

            var indexName = $"IX_{entityName}_{propertyName}";

            return(indexName);
        }