Esempio n. 1
0
 public void TestDictionaryIntExpression()
 {
     Expression<Func<SomeClass, object>> exp = (m) => m.IntDict[101].MyProperty;
     var propertyName = new PropertyNameResolver().Resolve(exp);
     var expected = "intDict.101.MID";
     Assert.AreEqual(expected, propertyName);
 }
Esempio n. 2
0
 public void TestCollectionIndexExpressionDoesNotEndUpInPath()
 {
     Expression<Func<SomeClass, object>> exp = (m) => m.ListOfCustomClasses[101].MyProperty;
     var propertyName = new PropertyNameResolver().Resolve(exp);
     var expected = "listOfCustomClasses.MID";
     Assert.AreEqual(expected, propertyName);
 }
Esempio n. 3
0
 public void TestCreatedDate()
 {
     Expression<Func<SomeOtherClass, object>> exp = (m) => m.CreateDate;
     var propertyName = new PropertyNameResolver().Resolve(exp);
     var expected = "CreateDate";
     Assert.AreEqual(expected, propertyName);
 }
Esempio n. 4
0
 public void TestUsesElasticProperty()
 {
     Expression<Func<SomeClass, object>> exp = (m) => m.MyCustomClass.MyProperty;
     var propertyName = new PropertyNameResolver().Resolve(exp);
     var expected = "myCustomClass.MID";
     Assert.AreEqual(expected, propertyName);
 }
Esempio n. 5
0
 public void TestDictionaryStringExpression()
 {
     Expression<Func<SomeClass, object>> exp = (m) => m.StringDict["someValue"].CreateDate;
     var propertyName = new PropertyNameResolver().Resolve(exp);
     var expected = "stringDict.someValue.CreateDate";
     Assert.AreEqual(expected, propertyName);
 }
Esempio n. 6
0
 public void TestUsesOtherElasticTypePropertyIsIgnored()
 {
     Expression<Func<SomeOtherClass, object>> exp = (m) => m.MyCustomOtherClass.MyProperty;
     var propertyName = new PropertyNameResolver().Resolve(exp);
     var expected = "myCustomOtherClass.MID";
     Assert.AreEqual(expected, propertyName);
 }
Esempio n. 7
0
 public TypeNameResolver(IConnectionSettings connectionSettings)
 {
     connectionSettings.ThrowIfNull("hasDefaultIndices");
     this._connectionSettings   = connectionSettings;
     this._propertyNameResolver = new PropertyNameResolver(this._connectionSettings);
 }
Esempio n. 8
0
 public void TestDictionaryStringDiffValues()
 {
     string index = "someValue1";
     Expression<Func<SomeClass, object>> exp = (m) => m.StringDict[index].CreateDate;
     var propertyName = new PropertyNameResolver().Resolve(exp);
     var expected1 = "stringDict.someValue1.CreateDate";
     Assert.AreEqual(expected1, propertyName);
     index = "someValue2";
     exp = (m) => m.StringDict[index].CreateDate;
     propertyName = new PropertyNameResolver().Resolve(exp);
     var expected2 = "stringDict.someValue2.CreateDate";
     Assert.AreEqual(expected2, propertyName);
 }
Esempio n. 9
0
 public TypeNameResolver(IConnectionSettingsValues connectionSettings)
 {
     connectionSettings.ThrowIfNull("connectionSettings");
     this._connectionSettings   = connectionSettings;
     this._propertyNameResolver = new PropertyNameResolver(this._connectionSettings);
 }