Skip to content

Commit 9ed7753

Browse files
committed
required changes
1 parent cbfee91 commit 9ed7753

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

Extensions/Xtensive.Orm.Localization.Tests/Model/DictionaryModel.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
using System;
1+
// Copyright (C) 2020 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
4+
25
using System.Globalization;
36
using Xtensive.Orm.Model;
47

@@ -8,15 +11,15 @@ namespace Xtensive.Orm.Localization.Tests.Model
811
public abstract class AbstractDictionary : Entity
912
{
1013
[Key, Field]
11-
public int Id { get; set; }
14+
public int Id { get; private set; }
1215

1316
[Field(Nullable = false, Length = 64)]
1417
public string Identifier { get; set; }
1518

1619
// abstract property
1720
public abstract string Name { get; set; }
1821

19-
public AbstractDictionary(Session session) : base(session) { }
22+
protected AbstractDictionary(Session session) : base(session) { }
2023
}
2124

2225
public abstract class AbstractLocalizableDictionary<T, TT> : AbstractDictionary, ILocalizable<TT>
@@ -28,7 +31,7 @@ public abstract class AbstractLocalizableDictionary<T, TT> : AbstractDictionary,
2831
[Field]
2932
public LocalizationSet<TT> Localizations { get; private set; }
3033

31-
public AbstractLocalizableDictionary(Session session) : base(session) { }
34+
protected AbstractLocalizableDictionary(Session session) : base(session) { }
3235
}
3336

3437
public abstract class AbstractDictionaryLocalization<T, TT> : Localization<T>
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright (C) 2020 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
4+
15
using System.Linq;
26
using System.Threading;
37
using NUnit.Framework;
@@ -10,9 +14,8 @@ public class ProjectionToCustomTypesTests : AutoBuildTest
1014
{
1115
protected override void PopulateDatabase()
1216
{
13-
using (var session = Domain.OpenSession()) {
14-
using (var ts = session.OpenTransaction()) {
15-
17+
using (var session = Domain.OpenSession())
18+
using (var ts = session.OpenTransaction()) {
1619
// populating database
1720
var m1 = new Country(session) {
1821
Identifier = "HUN",
@@ -22,22 +25,22 @@ protected override void PopulateDatabase()
2225
Identifier = "RUS",
2326
Name = "Oroszország"
2427
};
25-
using (new LocalizationScope(EnglishCulture))
28+
using (new LocalizationScope(EnglishCulture)) {
2629
m2.Name = "Russia";
27-
using (new LocalizationScope(SpanishCulture))
28-
m2.Name = "Rusia";
29-
30-
ts.Complete();
31-
}
30+
}
31+
using (new LocalizationScope(SpanishCulture)) {
32+
m2.Name = "Rusia";
33+
}
34+
ts.Complete();
3235
}
3336
}
3437

3538
[Test]
3639
public void EntityHierarchyWithAbstractPropertyTest()
3740
{
3841
Thread.CurrentThread.CurrentCulture = EnglishCulture;
39-
using (var session = Domain.OpenSession()) {
40-
using (var ts = session.OpenTransaction()) {
42+
using (var session = Domain.OpenSession())
43+
using (var ts = session.OpenTransaction()) {
4144
var q = session.Query.All<Country>().OrderBy(e => e.Identifier).Select(e => new { e.Name });
4245
var l = q.ToList();
4346
// assertions
@@ -47,9 +50,7 @@ public void EntityHierarchyWithAbstractPropertyTest()
4750
Assert.AreEqual(propertyInfos.First().Name, nameof(Country.Name));
4851
Assert.AreEqual(l.First().Name, "Magyarország");
4952
Assert.AreEqual(l.Last().Name, "Russia");
50-
}
5153
}
5254
}
53-
5455
}
5556
}

0 commit comments

Comments
 (0)