Skip to content

Commit c9336cc

Browse files
Purge tests compilation warnings.
1 parent 9527cb0 commit c9336cc

File tree

74 files changed

+246
-24
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+246
-24
lines changed

src/NHibernate.Test/Generatedkeys/Identity/MyEntityIdentity.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ namespace NHibernate.Test.Generatedkeys.Identity
22
{
33
public class MyEntityIdentity
44
{
5+
// Assigned by reflection
6+
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
57
private int id;
8+
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
69
private string name;
710

811
public virtual int Id

src/NHibernate.Test/Generatedkeys/Select/MyEntity.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ namespace NHibernate.Test.Generatedkeys.Select
22
{
33
public class MyEntity
44
{
5+
// Assigned by reflection
6+
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
57
private int id;
8+
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
69
private string name;
710
protected MyEntity() {}
811

src/NHibernate.Test/Generatedkeys/Seqidentity/MyEntity.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ namespace NHibernate.Test.Generatedkeys.Seqidentity
22
{
33
public class MyEntity
44
{
5+
// Assigned by reflection
6+
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
57
private int id;
8+
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
69
private string name;
710

811
public virtual int Id

src/NHibernate.Test/Hql/Ast/KeyManyToOneEntity.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ namespace NHibernate.Test.Hql.Ast
44
{
55
public class KeyManyToOneEntity
66
{
7+
// Used by reflection
8+
#pragma warning disable CS0169 // The field is never used
79
private Id id;
10+
#pragma warning restore CS0169 // The field is never used
811
private string name;
912

1013
public virtual string Name

src/NHibernate.Test/Hql/Ast/KeyManyToOneKeyEntity.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ namespace NHibernate.Test.Hql.Ast
22
{
33
public class KeyManyToOneKeyEntity
44
{
5+
// Assigned by reflection
6+
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
57
private long id;
8+
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
69
private string name;
710
private int? requestedHash;
811

src/NHibernate.Test/IdGen/Enhanced/Forcedtable/Entity.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
public class Entity
44
{
55

6-
#pragma warning disable 0414 // unassigned variable
6+
// Assigned by reflection
7+
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
78
private long _id;
8-
#pragma warning restore 0414
9+
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
910

1011
public virtual long Id
1112
{

src/NHibernate.Test/IdGen/Enhanced/Sequence/Entity.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
{
33
public class Entity
44
{
5-
6-
#pragma warning disable 0414 // unassigned variable
5+
// Assigned by reflection
6+
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value 0
77
private long _id;
8-
#pragma warning restore 0414
8+
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value 0
99

1010
public virtual long Id
1111
{

src/NHibernate.Test/IdGen/Enhanced/Table/Entity.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ namespace NHibernate.Test.IdGen.Enhanced.Table
22
{
33
public class Entity
44
{
5-
6-
#pragma warning disable 0414 // unassigned variable
5+
// Assigned by reflection
6+
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
77
private long _id;
8-
#pragma warning restore 0414
8+
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
99

1010
public virtual long Id
1111
{

src/NHibernate.Test/MappingByCode/ConventionModelMapperTests/ComponetsAccessorTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ public class ComponetsAccessorTests
1010
private class MyClass
1111
{
1212
public int Id { get; set; }
13+
// Assigned by reflection
14+
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
1315
private MyCompo compo;
16+
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
1417
public MyCompo Compo
1518
{
1619
get { return compo; }

src/NHibernate.Test/MappingByCode/ConventionModelMapperTests/ComponetsParentAccessorTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ private class MyClass
1717

1818
private class MyCompo
1919
{
20+
// Assigned by reflection
21+
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
2022
private MyClass parent;
23+
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
24+
2125
public MyClass Parent
2226
{
2327
get { return parent; }
@@ -28,7 +32,10 @@ public MyClass Parent
2832

2933
private class MyNestedCompo
3034
{
35+
// Assigned by reflection
36+
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
3137
private MyCompo owner;
38+
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
3239
public MyCompo Owner
3340
{
3441
get { return owner; }

0 commit comments

Comments
 (0)