public void Should_translate_deeply_nested_select_expression() { Expression <Func <DeepStructuredObject, object> > expression = d => new { d.Level0.Level1.Level2.FinalProperty }; var expectedResults = new List <string>() { "Level0_Level1_Level2_FinalProperty" }; var translated = AzureStorageQuerySelectTranslator.TranslateExpressionToMemberNames(expression, _entityPropertyConverterOptions); for (var i = 0; i < translated.Count; i++) { translated[i].Should().Be(expectedResults[i]); } }
public void Should_translate_select_expression_2() { Expression <Func <UserProfile, object> > expression = profile => new { RowKey = "", PartitionKey = "" }; var expectedResults = new List <string>() { "RowKey", "PartitionKey" }; var translated = AzureStorageQuerySelectTranslator.TranslateExpressionToMemberNames(expression, _entityPropertyConverterOptions); for (var i = 0; i < translated.Count; i++) { translated[i].Should().Be(expectedResults[i]); } }
public void Should_translate_select_expression() { Expression <Func <UserProfile, object> > expression = profile => new { profile.Name, profile.Age, profile.ExtendedProperties.HasVisitedBefore }; var expectedResults = new List <string>() { "Name", "Age", "ExtendedProperties_HasVisitedBefore" }; var translated = AzureStorageQuerySelectTranslator.TranslateExpressionToMemberNames(expression, _entityPropertyConverterOptions); for (var i = 0; i < translated.Count; i++) { translated[i].Should().Be(expectedResults[i]); } }