Permalink
Browse files

Add unit tests

  • Loading branch information...
asherber authored and pleb committed Sep 22, 2018
1 parent a7dcffd commit 2ab0f925f501d866b612b4ba61656560413649ab
Showing with 28 additions and 0 deletions.
  1. +28 −0 PetaPoco.Tests.Unit/Core/PocoDataTests.cs
@@ -29,5 +29,33 @@ private TestEntity(string arg1)
{
}
}
public class PocoWithResultColumn
{
public string RegularProperty { get; set; }
[ResultColumn]
public string ResultProperty { get; set; }
}
public class PocoWithIncludedResultColumn
{
public string RegularProperty { get; set; }
[ResultColumn(IncludeInAutoSelect.Yes)]
public string ResultProperty { get; set; }
}
[Fact]
public void PD_ResultColumn_NotInAutoSelect()
{
var pd = PocoData.ForType(typeof(PocoWithResultColumn), new ConventionMapper());
pd.QueryColumns.ShouldBe(new[] { "RegularProperty" });
}
[Fact]
public void PD_IncludedResultColumn_InAutoSelect()
{
var pd = PocoData.ForType(typeof(PocoWithIncludedResultColumn), new ConventionMapper());
pd.QueryColumns.ShouldBe(new[] { "RegularProperty", "ResultProperty" });
}
}
}

0 comments on commit 2ab0f92

Please sign in to comment.