Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit b6905c7

Browse files
committed
Update SchemaTest to include test data
1 parent 3181b0c commit b6905c7

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

tests/ServiceStack.OrmLite.Tests/Issues/SchemaTests.cs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void Can_join_on_table_with_schemas()
4646
{
4747
Id = 1,
4848
Child = new SchemaTable2 { Name = "Foo" }
49-
}, references:true);
49+
}, references: true);
5050

5151
db.Save(new SchemaTable1
5252
{
@@ -76,13 +76,16 @@ public void Can_query_with_Schema_and_alias_attributes()
7676
db.DropAndCreateTable<Section>();
7777
db.DropAndCreateTable<Page>();
7878

79-
db.Save(new Page {
79+
db.Save(new Page
80+
{
8081
SectionId = 1,
8182
}, references: true);
82-
db.Save(new Page {
83+
db.Save(new Page
84+
{
8385
SectionId = 2,
8486
}, references: true);
85-
db.Save(new Section {
87+
db.Save(new Section
88+
{
8689
Id = 1,
8790
Name = "Name1",
8891
ReportId = 15,
@@ -114,12 +117,20 @@ public void Does_complex_query_using_Schemas_with_LeftJoins()
114117
db.DropAndCreateTable<Page>();
115118
db.DropAndCreateTable<Section>();
116119

120+
db.Insert(new Editable { Index = 1, Content = "Content", PageId = 1, Styles = "Styles", TypeId = 1 });
121+
db.Insert(new EditableRevision { Content = "Content", Styles = "Styles", Date = DateTime.UtcNow, EditableId = 1, EmployeeId = 1, Reason = "Reason" });
122+
db.Insert(new LogEntry { Date = DateTime.UtcNow, KlasId = 1, PageId = 1, PageTrackerId = 1, ReportId = 1, RequestUrl = "http://url.com", TypeId = 1 });
123+
db.Insert(new Report { DefaultAccessLevel = 1, Description = "Description", Name = "Name" });
124+
db.Insert(new Page { AccessLevel = 1, AssignedEmployeeId = 1, Index = 1, SectionId = 1, Template = "Template" });
125+
db.Insert(new Section { Name = "Name", ReportId = 1 });
126+
117127
var q = db.From<Section>()
118128
.Join<Section, Page>((s, p) => s.Id == p.SectionId)
119129
.Join<Page, Editable>((p, e) => p.Id == e.PageId)
120-
.Where<Section, Page>((s, p) => s.ReportId == 15 && p.Index == 24);
130+
.Where<Section, Page>((s, p) => s.ReportId == 1 && p.Index == 1);
121131

122132
var result = db.Select<Editable>(q);
133+
result.PrintDump();
123134

124135
db.GetLastSql().Print();
125136
}

0 commit comments

Comments
 (0)