Skip to content

Commit ab9d883

Browse files
NH-3905 - More tests generation.
1 parent 4d99b2b commit ab9d883

File tree

268 files changed

+465
-192
lines changed

Some content is hidden

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

268 files changed

+465
-192
lines changed

Tools/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.6.0" targetFramework="net461" />
88
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.2" targetFramework="net461" />
99
<package id="NUnit.Extension.VSProjectLoader" version="3.6.0" targetFramework="net461" />
10-
<package id="CSharpAsyncGenerator.CommandLine" version="0.3.6" targetFramework="net461" />
10+
<package id="CSharpAsyncGenerator.CommandLine" version="0.4.0" targetFramework="net461" />
1111
</packages>

src/AsyncGenerator.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@
180180
hasAttributeName: IgnoreAttribute
181181
- conversion: NewType
182182
hasAttributeName: TestFixtureAttribute
183+
- conversion: NewType
184+
anyBaseTypeRule: HasTestFixtureAttribute
183185
- conversion: Ignore
184186
rule: IsTestCase
185187
- conversion: Ignore
@@ -246,3 +248,6 @@ typeRules:
246248
- filters:
247249
- name: TestCase
248250
name: IsTestCase
251+
- filters:
252+
- hasAttributeName: TestFixtureAttribute
253+
name: HasTestFixtureAttribute

src/NHibernate.Test/CfgTest/AccessorsSerializableTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace NHibernate.Test.CfgTest
77
{
8+
[TestFixture]
89
public class AccessorsSerializableTest
910
{
1011
private static System.Type[] accessors = typeof (IPropertyAccessor).Assembly.GetTypes().Where(t => t.Namespace == typeof (IPropertyAccessor).Namespace && t.GetInterfaces().Contains(typeof (IPropertyAccessor))).ToArray();

src/NHibernate.Test/CfgTest/ConfigurationAddMappingEvents.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace NHibernate.Test.CfgTest
99
{
10+
[TestFixture]
1011
public class ConfigurationAddMappingEvents
1112
{
1213
private const string ProductLineMapping =
@@ -72,4 +73,4 @@ public void WhenSubscribedToAfterBindThenRaiseEventForEachMapping()
7273
Assert.That(listOfCalls.Select(x => x.Dialect).All(x => x.GetType() == typeof(MsSql2008Dialect)), Is.True);
7374
}
7475
}
75-
}
76+
}

src/NHibernate.Test/CfgTest/CustomBytecodeProviderTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace NHibernate.Test.CfgTest
99
{
10+
[TestFixture]
1011
public class CustomBytecodeProviderTest
1112
{
1213
private class MyByteCodeProvider : AbstractBytecodeProvider

src/NHibernate.Test/CfgTest/Loquacious/NamedQueryTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace NHibernate.Test.CfgTest.Loquacious
66
{
7+
[TestFixture]
78
public class NamedQueryTests
89
{
910
[Test]
@@ -72,4 +73,4 @@ public void WhenSetValidTimeoutThenSetValue()
7273
Assert.That(configure.NamedQueries.Values.Single().Timeout, Is.EqualTo(123));
7374
}
7475
}
75-
}
76+
}

src/NHibernate.Test/Component/Basic/ComponentWithUniqueConstraintTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
namespace NHibernate.Test.Component.Basic
1414
{
15+
[TestFixture]
1516
public class ComponentWithUniqueConstraintTests : TestCaseMappingByCode
1617
{
1718
protected override HbmMapping GetMappings()

src/NHibernate.Test/DialectTest/MsSqlCe40DialectFixture.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace NHibernate.Test.DialectTest
66
{
7+
[TestFixture]
78
public class MsSqlCe40DialectFixture
89
{
910
[Test]

src/NHibernate.Test/DriverTest/DbProviderFactoryDriveConnectionCommandProviderTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace NHibernate.Test.DriverTest
77
{
8+
[TestFixture]
89
public class DbProviderFactoryDriveConnectionCommandProviderTest
910
{
1011
[Test]
@@ -35,4 +36,4 @@ public void WhenCreatedWithDbFactoryThenCanReturnCommand()
3536
}
3637
}
3738
}
38-
}
39+
}

src/NHibernate.Test/DriverTest/ReflectionBasedDriverTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace NHibernate.Test.DriverTest
66
{
7+
[TestFixture]
78
public class ReflectionBasedDriverTest
89
{
910
private class MyDriverWithWrongClassesAndGoodDbProviderFactory : ReflectionBasedDriver
@@ -114,4 +115,4 @@ public void WhenCreatedNoWithDbFactoryThenCanReturnCommand()
114115
}
115116
}
116117
}
117-
}
118+
}

src/NHibernate.Test/DriverTest/Sql2008DateTime2Test.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class EntityForMs2008
1414
public virtual TimeSpan TimeSpanProp { get; set; }
1515
}
1616

17+
[TestFixture]
1718
public class Sql2008DateTime2Test : TestCase
1819
{
1920
protected override void Configure(Configuration configuration)
@@ -70,4 +71,4 @@ public void Crud()
7071
}
7172

7273
}
73-
}
74+
}

src/NHibernate.Test/DynamicProxyTests/InterfaceWithEqualsGethashcodeTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace NHibernate.Test.DynamicProxyTests
66
{
7+
[TestFixture]
78
public class InterfaceWithEqualsGethashcodeTests
89
{
910
public interface IMyBaseObject
@@ -40,4 +41,4 @@ public void WhenProxyAnInterfaceShouldInterceptEquals()
4041
Assert.That(interceptor.InterceptedMethods, Contains.Item("Equals"));
4142
}
4243
}
43-
}
44+
}

src/NHibernate.Test/DynamicProxyTests/PeVerifyFixture.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace NHibernate.Test.DynamicProxyTests
99
{
10+
[TestFixture]
1011
public class PeVerifyFixture
1112
{
1213
private static bool wasCalled;

src/NHibernate.Test/DynamicProxyTests/ProxiedMembers/Fixture.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public virtual void Method2(ref int x)
1616
}
1717
}
1818

19+
[TestFixture]
1920
public class Fixture
2021
{
2122
[Test]
@@ -33,4 +34,4 @@ public void Proxy()
3334
Assert.AreEqual(5, x);
3435
}
3536
}
36-
}
37+
}

src/NHibernate.Test/DynamicProxyTests/ProxiedMembers/MetodWithRefDictionaryTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace NHibernate.Test.DynamicProxyTests.ProxiedMembers
66
{
7+
[TestFixture]
78
public class MetodWithRefDictionaryTest
89
{
910
public class MyClass
@@ -25,4 +26,4 @@ public void Proxy()
2526
Assert.That(myParam, Is.Not.SameAs(dictionary));
2627
}
2728
}
28-
}
29+
}

src/NHibernate.Test/Events/Collections/AbstractCollectionEventFixture.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace NHibernate.Test.Events.Collections
1010
{
11+
[TestFixture]
1112
public abstract class AbstractCollectionEventFixture : TestCase
1213
{
1314
protected override string MappingsAssembly
@@ -905,4 +906,4 @@ protected void CheckResult(CollectionListeners listeners, CollectionListeners.IL
905906
CheckResult(listeners, listenerExpected, child, child.Parents, index);
906907
}
907908
}
908-
}
909+
}

src/NHibernate.Test/Events/Collections/Association/AbstractAssociationCollectionEventFixture.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace NHibernate.Test.Events.Collections.Association
55
{
6+
[TestFixture]
67
public abstract class AbstractAssociationCollectionEventFixture : AbstractCollectionEventFixture
78
{
89
[Test]
@@ -36,4 +37,4 @@ public void DeleteParentButNotChild()
3637
CheckNumberOfResults(listeners, index);
3738
}
3839
}
39-
}
40+
}

src/NHibernate.Test/Events/DisposableListenersTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public void Dispose()
1818
}
1919
}
2020

21+
[TestFixture]
2122
public partial class DisposableListenersTest
2223
{
2324
[Test]
@@ -31,4 +32,4 @@ public void WhenCloseSessionFactoryThenCallDisposeOfListener()
3132
Assert.That(myDisposableListener.DisposeCalled, Is.True);
3233
}
3334
}
34-
}
35+
}

src/NHibernate.Test/Futures/LinqToFutureValueFixture.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace NHibernate.Test.Futures
66
{
7+
[TestFixture]
78
public class LinqToFutureValueFixture : FutureFixture
89
{
910
[Test]
@@ -56,4 +57,4 @@ protected override void OnTearDown()
5657
}
5758
}
5859
}
59-
}
60+
}

src/NHibernate.Test/GeneratedTest/AbstractGeneratedPropertyTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace NHibernate.Test.GeneratedTest
66
{
7+
[TestFixture]
78
public abstract class AbstractGeneratedPropertyTest : TestCase
89
{
910
protected override string MappingsAssembly

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace NHibernate.Test.Hql.Ast
77
{
8+
[TestFixture]
89
public class QuerySubstitutionTest: BaseFixture
910
{
1011
protected override void Configure(NHibernate.Cfg.Configuration configuration)

src/NHibernate.Test/Immutable/EntityWithMutableCollection/AbstractEntityWithManyToManyTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace NHibernate.Test.Immutable.EntityWithMutableCollection
1111
/// <summary>
1212
/// Hibernate tests ported from trunk revision 19910 (July 8, 2010)
1313
/// </summary>
14+
[TestFixture]
1415
public abstract class AbstractEntityWithManyToManyTest : TestCase
1516
{
1617
private bool isPlanContractsInverse;

src/NHibernate.Test/Immutable/EntityWithMutableCollection/AbstractEntityWithOneToManyTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace NHibernate.Test.Immutable.EntityWithMutableCollection
1111
/// <summary>
1212
/// Hibernate tests ported from trunk revision 19910 (July 8, 2010)
1313
/// </summary>
14+
[TestFixture]
1415
public abstract class AbstractEntityWithOneToManyTest : TestCase
1516
{
1617
private bool isContractPartiesInverse;

src/NHibernate.Test/Insertordering/InsertOrderingFixture.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
namespace NHibernate.Test.Insertordering
1717
{
18+
[TestFixture]
1819
public class InsertOrderingFixture : TestCase
1920
{
2021
const int batchSize = 10;
@@ -613,4 +614,4 @@ public IBatcher CreateBatcher(ConnectionManager connectionManager, IInterceptor
613614

614615
#endregion
615616
}
616-
}
617+
}

src/NHibernate.Test/Linq/ByMethod/CastTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace NHibernate.Test.Linq.ByMethod
77
{
8+
[TestFixture]
89
public class CastTests : LinqTestCase
910
{
1011
[Test]
@@ -49,4 +50,4 @@ public void CastDowncastUsingOfType()
4950
Assert.That(() => query.ToList(), Throws.Exception);
5051
}
5152
}
52-
}
53+
}

src/NHibernate.Test/Linq/CharComparisonTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace NHibernate.Test.Linq
1010
{
11+
[TestFixture]
1112
public class CharEqualityTests : TestCaseMappingByCode
1213
{
1314
protected override HbmMapping GetMappings()
@@ -193,4 +194,4 @@ public class Person
193194
public virtual string Name { get; set; }
194195
public virtual char Type { get; set; }
195196
}
196-
}
197+
}

src/NHibernate.Test/Linq/CustomExtensionsExample.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public override HqlTreeNode BuildHql(MethodInfo method, Expression targetObject,
4848
}
4949
}
5050

51+
[TestFixture]
5152
public class CustomExtensionsExample : LinqTestCase
5253
{
5354
protected override void Configure(NHibernate.Cfg.Configuration configuration)
@@ -63,4 +64,4 @@ public void CanUseMyCustomExtension()
6364
Assert.That(contacts.All(c => c.ContactName.Contains("Thomas")), Is.True);
6465
}
6566
}
66-
}
67+
}

src/NHibernate.Test/Linq/CustomQueryModelRewriterTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace NHibernate.Test.Linq
1313
{
14+
[TestFixture]
1415
public class CustomQueryModelRewriterTests : LinqTestCase
1516
{
1617
protected override void Configure(Cfg.Configuration configuration)

src/NHibernate.Test/Linq/ExpressionSessionLeakTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace NHibernate.Test.Linq
99
{
10+
[TestFixture]
1011
public class ExpressionSessionLeakTest : LinqTestCase
1112
{
1213
[Test]

src/NHibernate.Test/Linq/LinqToHqlGeneratorsRegistryFactoryTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace NHibernate.Test.Linq
99
{
10+
[TestFixture]
1011
public class LinqToHqlGeneratorsRegistryFactoryTest
1112
{
1213
[Test]
@@ -54,4 +55,4 @@ public void RegisterGenerator(IRuntimeMethodHqlGenerator generator)
5455
}
5556
}
5657
}
57-
}
58+
}

src/NHibernate.Test/Linq/QueryTimeoutTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace NHibernate.Test.Linq
1111
{
12+
[TestFixture]
1213
public class QueryTimeoutTests : LinqTestCase
1314
{
1415
protected override bool AppliesTo(Dialect.Dialect dialect)

src/NHibernate.Test/Linq/StatelessSessionQueringTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace NHibernate.Test.Linq
88
{
9+
[TestFixture]
910
public class StatelessSessionQueringTest : LinqTestCase
1011
{
1112
[Test]
@@ -29,4 +30,4 @@ public void AggregateWithStartsWith()
2930
}
3031
}
3132
}
32-
}
33+
}

0 commit comments

Comments
 (0)