public void CanRevealWithAliasFromTypedExpressionUsingProvidedConvention() { UserEntity u = null; Assert .That ( Reveal.ByConvention <UserEntity>(x => u.Password, new UnderscoreConvention()), Is.EqualTo("u._Password") ); }
public void CanSetDefaultConventionToConventionDelegate() { Reveal.SetDefaultConvention(s => "L" + s); Assert.That(Reveal.ByConvention <UserEntity>(x => x.Password), Is.EqualTo("LPassword")); UserEntity u = null; Assert.That(Reveal.ByConvention(() => u.Password), Is.EqualTo("u.LPassword")); Assert.That(Reveal.ByConvention(() => u, x => x.Password), Is.EqualTo("u.LPassword")); IRevealer revealer = Reveal.CreateRevealer(); Assert.That(revealer.Reveal <UserEntity>(x => x.Password), Is.EqualTo("LPassword")); IRevealer <UserEntity> revealerOfUser = Reveal.CreateRevealer <UserEntity>(); Assert.That(revealerOfUser.Reveal(x => x.Password), Is.EqualTo("LPassword")); }
/// <inheritdoc /> public virtual IFetchBuilder <TQuery> Fetch ( Expression <Func <TSource, object> > expression, Expression <Func <object> > alias = null, IRevealConvention revealConvention = null ) { if (revealConvention == null) { revealConvention = Reveal.DefaultConvention ?? new CustomConvention(x => x); } string path = Reveal.ByConvention(expression, revealConvention); string aliasValue = alias != null ? ExpressionHelper.GetPropertyName(alias) : path; return(FetchCore(path, aliasValue)); }
public void CanRevealWithAliasFromTypedExpression() { UserEntity u = null; Assert.That(Reveal.ByConvention <UserEntity>(x => u.Password), Is.EqualTo("u.m_Password")); }
public void CanRevealDeepWithAliasFromUntypedExpression() { UserEntity u = null; Assert.That(Reveal.ByConvention(() => u.Setting.Id), Is.EqualTo("u.Setting.m_Id")); }
public void CanRevealDeep() { Assert.That(Reveal.ByConvention <UserEntity>(x => x.Setting.Id), Is.EqualTo("Setting.m_Id")); }
public void UsesMUnderscoreConventionByDefault() { Assert.That(Reveal.ByConvention <UserEntity>(x => x.Password), Is.EqualTo("m_Password")); }
public void CanSetDefaultConvention() { Reveal.SetDefaultConvention(new CustomConvention(s => "ere" + s + "::-")); Assert.That(Reveal.ByConvention <UserEntity>(x => x.Username), Is.EqualTo("ereUsername::-")); }
public void CanRevealWithoutSpecifyingDefaultConvention() { Assert.That(() => Reveal.ByConvention <UserEntity>(x => x.Password), Throws.Nothing); }
public void CanRevealWithConventionSpecified() { Assert.That(Reveal.ByConvention <UserEntity>(x => x.Username, new MConvention()), Is.EqualTo("mUsername")); }