public void GetPropertyPath() { // ARRANGE var classSpecifics = ClassSpecifics.Of <ClassSpecificsTest>(); // ACT var propertyDisplayName = classSpecifics.GetPropertyPath(test => test.Property2); // ASSERT Assert.That(propertyDisplayName, Is.EqualTo("Property2")); }
public void GetPropertyInfo() { // ARRANGE var classSpecifics = ClassSpecifics.Of <ClassSpecificsTest>(); // ACT var propertyDisplayName = classSpecifics.GetPropertyInfo(test => test.Property2); // ASSERT Assert.That(propertyDisplayName, Is.Not.Null); }
public void GetPropertyDisplayNameForPropertyWithoutDisplayAttribute() { // ARRANGE var classSpecifics = ClassSpecifics.Of <ClassSpecificsTest>(); // ACT var propertyDisplayName = classSpecifics.GetPropertyDisplayName(test => test.Property1); // ASSERT Assert.That(propertyDisplayName, Is.Null); }
public void Off() { // ARRANGE var type = this.GetType(); // ACT var assemblyeSpecifics = ClassSpecifics.Of(type); // ASSERT Assert.That(assemblyeSpecifics, Is.Not.Null); }
public void GetField() { // ARRANGE var someClass = ClassSpecifics.Of <SomeClass>(); // ACT var field = someClass.GetFieldInfo(SomeClass.Field1Name); // ASSERT Assert.That(field, Is.Not.Null); }
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); }