Skip to content

Commit 4acb76e

Browse files
committed
Another attempt to fix test
1 parent 55c61f8 commit 4acb76e

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/NHibernate.DomainModel/Container.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public Glarch Glarch
9292
private IDictionary<string, Ternary> _ternaryMap;
9393
//<set> mapping
9494
private ISet<Ternary> _ternarySet;
95-
private One _one;
95+
private Simple _manyToOne;
9696

9797
public virtual IList<Simple> OneToMany
9898
{
@@ -130,10 +130,10 @@ public virtual long Id
130130
set { _id = value; }
131131
}
132132

133-
public virtual One One
133+
public virtual Simple ManyToOne
134134
{
135-
get => _one;
136-
set => _one = value;
135+
get => _manyToOne;
136+
set => _manyToOne = value;
137137
}
138138

139139
public virtual IList<Contained> Bag

src/NHibernate.DomainModel/Container.hbm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
>
2323
<generator class="native" />
2424
</id>
25-
<one-to-one name="One" />
25+
<many-to-one name="ManyToOne" lazy="proxy" />
2626
<list
2727
name="OneToMany"
2828
lazy="true"

src/NHibernate.Test/Async/Legacy/ParentChildTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,15 +383,15 @@ public async Task CollectionQueryAsync()
383383
l.Add(null);
384384
l.Add(s2);
385385
c.ManyToMany = l;
386-
c.One = new One { Value = "one" };
387-
await (s.SaveAsync(c.One));
386+
c.ManyToOne = new Simple { Name = "x", Count = 4};
387+
await (s.SaveAsync(c.ManyToOne, c.ManyToOne.Count));
388388
await (s.SaveAsync(c));
389389

390390
Assert.AreEqual(1,
391391
(await (s.CreateQuery("select c from c in class ContainerX, s in class Simple where c.OneToMany[2] = s").ListAsync
392392
())).Count);
393393
Assert.AreEqual(1,
394-
(await (s.CreateQuery("select c from c in class ContainerX, s in class Simple where c.OneToMany[2] = s and c.One != null").ListAsync
394+
(await (s.CreateQuery("select c from c in class ContainerX, s in class Simple where c.OneToMany[2] = s and c.ManyToOne.Name = 'x'").ListAsync
395395
())).Count);
396396
Assert.AreEqual(1,
397397
(await (s.CreateQuery("select c from c in class ContainerX, s in class Simple where c.ManyToMany[2] = s").
@@ -429,7 +429,7 @@ public async Task CollectionQueryAsync()
429429
"select c from c in class ContainerX where c.ManyToMany[ c.OneToMany[0].Count ].Name = 's'").ListAsync())).
430430
Count);
431431

432-
await (s.DeleteAsync(c.One));
432+
await (s.DeleteAsync(c.ManyToOne));
433433
await (s.DeleteAsync(c));
434434
await (s.DeleteAsync(s1));
435435
await (s.DeleteAsync(s2));

src/NHibernate.Test/Legacy/ParentChildTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,15 +372,15 @@ public void CollectionQuery()
372372
l.Add(null);
373373
l.Add(s2);
374374
c.ManyToMany = l;
375-
c.One = new One { Value = "one" };
376-
s.Save(c.One);
375+
c.ManyToOne = new Simple { Name = "x", Count = 4};
376+
s.Save(c.ManyToOne, c.ManyToOne.Count);
377377
s.Save(c);
378378

379379
Assert.AreEqual(1,
380380
s.CreateQuery("select c from c in class ContainerX, s in class Simple where c.OneToMany[2] = s").List
381381
().Count);
382382
Assert.AreEqual(1,
383-
s.CreateQuery("select c from c in class ContainerX, s in class Simple where c.OneToMany[2] = s and c.One != null").List
383+
s.CreateQuery("select c from c in class ContainerX, s in class Simple where c.OneToMany[2] = s and c.ManyToOne.Name = 'x'").List
384384
().Count);
385385
Assert.AreEqual(1,
386386
s.CreateQuery("select c from c in class ContainerX, s in class Simple where c.ManyToMany[2] = s").
@@ -418,7 +418,7 @@ public void CollectionQuery()
418418
"select c from c in class ContainerX where c.ManyToMany[ c.OneToMany[0].Count ].Name = 's'").List().
419419
Count);
420420

421-
s.Delete(c.One);
421+
s.Delete(c.ManyToOne);
422422
s.Delete(c);
423423
s.Delete(s1);
424424
s.Delete(s2);

0 commit comments

Comments
 (0)