Skip to content

NH-3725 - Remove SharpTestsEx #362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 16, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed lib/net/SharpTestsEx.NUnit.dll
Binary file not shown.
772 changes: 0 additions & 772 deletions lib/net/SharpTestsEx.NUnit.xml

This file was deleted.

31 changes: 0 additions & 31 deletions lib/net/SharpTestsEx_License.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<include name="NHibernate.DomainModel.dll" />
<include name="NHibernate.dll" />
<include name="nunit.framework.dll" />
<include name="SharpTestsEx.NUnit.dll" />
<include name="System.Linq.Dynamic.dll" />
</assemblyfileset>
<resourcefileset id="project.resources" prefix="NHibernate.Test.VisualBasic" dynamicprefix="false">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void NotConfiguredProxyFactoryFactory()
{
var bcp = new BytecodeProviderImpl();
IProxyFactoryFactory p = bcp.ProxyFactoryFactory;
p.Should().Be.InstanceOf<DefaultProxyFactoryFactory>();
Assert.That(p, Is.InstanceOf<DefaultProxyFactoryFactory>());
}

[Test]
Expand Down
6 changes: 3 additions & 3 deletions src/NHibernate.Test/CfgTest/AccessorsSerializableTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ public class AccessorsSerializableTest
[Test, TestCaseSource("accessors")]
public void AllAccessorsAreMarkedAsSerializable(System.Type concreteAccessor)
{
concreteAccessor.Should().Have.Attribute<SerializableAttribute>();
Assert.That(concreteAccessor, Has.Attribute<SerializableAttribute>());
}

private static System.Type[] setters = typeof(ISetter).Assembly.GetTypes().Where(t => t.Namespace == typeof(ISetter).Namespace && t.GetInterfaces().Contains(typeof(ISetter))).ToArray();

[Test, TestCaseSource("setters")]
public void AllSettersAreMarkedAsSerializable(System.Type concreteAccessor)
{
concreteAccessor.Should().Have.Attribute<SerializableAttribute>();
Assert.That(concreteAccessor, Has.Attribute<SerializableAttribute>());
}

private static System.Type[] getters = typeof(IGetter).Assembly.GetTypes().Where(t => t.Namespace == typeof(IGetter).Namespace && t.GetInterfaces().Contains(typeof(IGetter))).ToArray();

[Test, TestCaseSource("getters")]
public void AllGettersAreMarkedAsSerializable(System.Type concreteAccessor)
{
concreteAccessor.Should().Have.Attribute<SerializableAttribute>();
Assert.That(concreteAccessor, Has.Attribute<SerializableAttribute>());
}
}
}
20 changes: 10 additions & 10 deletions src/NHibernate.Test/CfgTest/ConfigurationAddMappingEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ public void WhenSubscribedToBeforeBindThenRaiseEventForEachMapping()
var listOfCalls = new List<BindMappingEventArgs>();
var configuration = new Configuration();
configuration.DataBaseIntegration(x => x.Dialect<MsSql2008Dialect>());
configuration.BeforeBindMapping += (sender, args) => { sender.Should().Be.SameInstanceAs(configuration); listOfCalls.Add(args); };
configuration.BeforeBindMapping += (sender, args) => { Assert.That(sender, Is.SameAs(configuration)); listOfCalls.Add(args); };

configuration.AddXmlString(ProductLineMapping);
configuration.AddXmlString(ModelMapping);

listOfCalls.Count.Should().Be(2);
listOfCalls.Select(x => x.FileName).All(x => x.Satisfy(filename => filename != null));
listOfCalls.Select(x => x.Mapping).All(x => x.Satisfy(mappingDoc => mappingDoc != null));
listOfCalls.Select(x => x.Dialect).All(x => x.Satisfy(dialect => dialect.GetType() == typeof(MsSql2008Dialect)));
Assert.That(listOfCalls.Count, Is.EqualTo(2));
Assert.That(listOfCalls.Select(x => x.FileName).All(x => x != null), Is.True);
Assert.That(listOfCalls.Select(x => x.Mapping).All(x => x != null), Is.True);
Assert.That(listOfCalls.Select(x => x.Dialect).All(x => x.GetType() == typeof (MsSql2008Dialect)), Is.True);
}

[Test]
Expand All @@ -62,15 +62,15 @@ public void WhenSubscribedToAfterBindThenRaiseEventForEachMapping()
var listOfCalls = new List<BindMappingEventArgs>();
var configuration = new Configuration();
configuration.DataBaseIntegration(x => x.Dialect<MsSql2008Dialect>());
configuration.AfterBindMapping += (sender, args) => { sender.Should().Be.SameInstanceAs(configuration); listOfCalls.Add(args); };
configuration.AfterBindMapping += (sender, args) => { Assert.That(sender, Is.SameAs(configuration)); listOfCalls.Add(args); };

configuration.AddXmlString(ProductLineMapping);
configuration.AddXmlString(ModelMapping);

listOfCalls.Count.Should().Be(2);
listOfCalls.Select(x => x.FileName).All(x => x.Satisfy(filename => filename != null));
listOfCalls.Select(x => x.Mapping).All(x => x.Satisfy(mappingDoc => mappingDoc != null));
listOfCalls.Select(x => x.Dialect).All(x => x.Satisfy(dialect => dialect.GetType() == typeof(MsSql2008Dialect)));
Assert.That(listOfCalls.Count, Is.EqualTo(2));
Assert.That(listOfCalls.Select(x => x.FileName).All(x => x != null), Is.True);
Assert.That(listOfCalls.Select(x => x.Mapping).All(x => x != null), Is.True);
Assert.That(listOfCalls.Select(x => x.Dialect).All(x => x.GetType() == typeof(MsSql2008Dialect)), Is.True);
}
}
}
2 changes: 1 addition & 1 deletion src/NHibernate.Test/CfgTest/ConfigurationSchemaFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void InvalidConfig()
public void FromAppConfigTest()
{
IHibernateConfiguration hc = ConfigurationManager.GetSection("hibernate-configuration") as IHibernateConfiguration;
hc.ByteCodeProviderType.Should().Be("lcg");
Assert.That(hc.ByteCodeProviderType, Is.EqualTo("lcg"));
Assert.IsTrue(hc.UseReflectionOptimizer);
Assert.AreEqual("NHibernate.Test", hc.SessionFactory.Name);
}
Expand Down
10 changes: 5 additions & 5 deletions src/NHibernate.Test/CfgTest/CustomBytecodeProviderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,29 @@ public override IReflectionOptimizer GetReflectionOptimizer(System.Type clazz, I
public void WhenNoShortCutUsedThenCanBuildBytecodeProvider()
{
var properties = new Dictionary<string, string> { { Environment.PropertyBytecodeProvider, typeof(MyByteCodeProvider).AssemblyQualifiedName } };
Executing.This(() => Environment.BuildBytecodeProvider(properties)).Should().NotThrow();
Assert.That(() => Environment.BuildBytecodeProvider(properties), Throws.Nothing);
}

[Test]
public void WhenNoShortCutUsedThenCanBuildInstanceOfConfiguredBytecodeProvider()
{
var properties = new Dictionary<string, string> { { Environment.PropertyBytecodeProvider, typeof(MyByteCodeProvider).AssemblyQualifiedName } };
Environment.BuildBytecodeProvider(properties).Should().Be.InstanceOf<MyByteCodeProvider>();
Assert.That(Environment.BuildBytecodeProvider(properties), Is.InstanceOf<MyByteCodeProvider>());
}

[Test]
public void WhenInvalidThenThrow()
{
var properties = new Dictionary<string, string> { { Environment.PropertyBytecodeProvider, typeof(InvalidByteCodeProvider).AssemblyQualifiedName } };
Executing.This(() => Environment.BuildBytecodeProvider(properties)).Should().Throw<HibernateByteCodeException>();
Assert.That(() => Environment.BuildBytecodeProvider(properties), Throws.TypeOf<HibernateByteCodeException>());
}

[Test]
public void WhenNoDefaultCtorThenThrow()
{
var properties = new Dictionary<string, string> { { Environment.PropertyBytecodeProvider, typeof(InvalidNoCtorByteCodeProvider).AssemblyQualifiedName } };
Executing.This(() => Environment.BuildBytecodeProvider(properties)).Should().Throw<HibernateByteCodeException>()
.And.Exception.InnerException.Message.Should().Contain("constructor was not found");
Assert.That(() => Environment.BuildBytecodeProvider(properties), Throws.TypeOf<HibernateByteCodeException>()
.And.InnerException.Message.ContainsSubstring("constructor was not found"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,29 @@ public void FullConfiguration()
p.ProxyFactoryFactory<DefaultProxyFactoryFactory>();
});
configure.Mappings(m=>
{
m.DefaultCatalog = "MyCatalog";
m.DefaultSchema = "MySche";
});
{
m.DefaultCatalog = "MyCatalog";
m.DefaultSchema = "MySche";
});
configure.DataBaseIntegration(db =>
{
db.Dialect<MsSql2000Dialect>();
db.KeywordsAutoImport = Hbm2DDLKeyWords.AutoQuote;
db.Batcher<SqlClientBatchingBatcherFactory>();
db.BatchSize = 15;
db.ConnectionProvider<DebugConnectionProvider>();
db.Driver<SqlClientDriver>();
db.ConnectionReleaseMode = ConnectionReleaseMode.AfterTransaction;
db.IsolationLevel = IsolationLevel.ReadCommitted;
db.ConnectionString = "The connection string";
db.AutoCommentSql = true;
db.ExceptionConverter<SQLStateConverter>();
db.PrepareCommands = true;
db.Timeout = 10;
db.MaximumDepthOfOuterJoinFetching = 11;
db.HqlToSqlSubstitutions = "true 1, false 0, yes 'Y', no 'N'";
db.SchemaAction = SchemaAutoAction.Validate;
});
{
db.Dialect<MsSql2000Dialect>();
db.KeywordsAutoImport = Hbm2DDLKeyWords.AutoQuote;
db.Batcher<SqlClientBatchingBatcherFactory>();
db.BatchSize = 15;
db.ConnectionProvider<DebugConnectionProvider>();
db.Driver<SqlClientDriver>();
db.ConnectionReleaseMode = ConnectionReleaseMode.AfterTransaction;
db.IsolationLevel = IsolationLevel.ReadCommitted;
db.ConnectionString = "The connection string";
db.AutoCommentSql = true;
db.ExceptionConverter<SQLStateConverter>();
db.PrepareCommands = true;
db.Timeout = 10;
db.MaximumDepthOfOuterJoinFetching = 11;
db.HqlToSqlSubstitutions = "true 1, false 0, yes 'Y', no 'N'";
db.SchemaAction = SchemaAutoAction.Validate;
});

Assert.That(configure.Properties[Environment.SessionFactoryName], Is.EqualTo("SomeName"));
Assert.That(configure.Properties[Environment.CacheProvider],
Expand Down Expand Up @@ -102,7 +102,7 @@ public void FullConfiguration()
Assert.That(configure.Properties[Environment.MaxFetchDepth], Is.EqualTo("11"));
Assert.That(configure.Properties[Environment.QuerySubstitutions], Is.EqualTo("true 1, false 0, yes 'Y', no 'N'"));
Assert.That(configure.Properties[Environment.Hbm2ddlAuto], Is.EqualTo("validate"));
configure.Properties[Environment.LinqToHqlGeneratorsRegistry].Should().Be(typeof(DefaultLinqToHqlGeneratorsRegistry).AssemblyQualifiedName);
Assert.That(configure.Properties[Environment.LinqToHqlGeneratorsRegistry], Is.EqualTo(typeof(DefaultLinqToHqlGeneratorsRegistry).AssemblyQualifiedName));
}
}
}
14 changes: 7 additions & 7 deletions src/NHibernate.Test/CfgTest/Loquacious/NamedQueryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public void AddSimpleNamedQuery()
b.Query = "from System.Object o";
});

configure.NamedQueries.Should().Have.Count.EqualTo(1);
configure.NamedQueries.Keys.Single().Should().Be("aQuery");
configure.NamedQueries.Values.Single().Query.Should().Be("from System.Object o");
Assert.That(configure.NamedQueries, Has.Count.EqualTo(1));
Assert.That(configure.NamedQueries.Keys.Single(), Is.EqualTo("aQuery"));
Assert.That(configure.NamedQueries.Values.Single().Query, Is.EqualTo("from System.Object o"));
}

[Test]
Expand All @@ -31,7 +31,7 @@ public void WhenSetInvalidFetchSizeThenLeaveDefault()
b.FetchSize = 0;
});

configure.NamedQueries.Values.Single().FetchSize.Should().Be(-1);
Assert.That(configure.NamedQueries.Values.Single().FetchSize, Is.EqualTo(-1));
}

[Test]
Expand All @@ -44,7 +44,7 @@ public void WhenSetValidFetchSizeThenSetValue()
b.FetchSize = 15;
});

configure.NamedQueries.Values.Single().FetchSize.Should().Be(15);
Assert.That(configure.NamedQueries.Values.Single().FetchSize, Is.EqualTo(15));
}

[Test]
Expand All @@ -57,7 +57,7 @@ public void WhenSetInvalidTimeoutThenLeaveDefault()
b.Timeout = 0;
});

configure.NamedQueries.Values.Single().Timeout.Should().Be(-1);
Assert.That(configure.NamedQueries.Values.Single().Timeout, Is.EqualTo(-1));
}

[Test]
Expand All @@ -70,7 +70,7 @@ public void WhenSetValidTimeoutThenSetValue()
b.Timeout = 123;
});

configure.NamedQueries.Values.Single().Timeout.Should().Be(123);
Assert.That(configure.NamedQueries.Values.Single().Timeout, Is.EqualTo(123));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -335,15 +335,15 @@ public void TestSignatureNonGeneric()
{
MethodInfo thisMethod = GetType().GetMethod("NonGenericMethod");

ExpressionProcessor.Signature(thisMethod).Should().Be("NHibernate.Test.Criteria.Lambda.ExpressionProcessorFixture:Void NonGenericMethod(System.String)");
Assert.That(ExpressionProcessor.Signature(thisMethod), Is.EqualTo("NHibernate.Test.Criteria.Lambda.ExpressionProcessorFixture:Void NonGenericMethod(System.String)"));
}

[Test]
public void TestSignatureGeneric()
{
MethodInfo thisMethod = GetType().GetMethod("GenericMethod");

ExpressionProcessor.Signature(thisMethod).Should().Be("NHibernate.Test.Criteria.Lambda.ExpressionProcessorFixture:T GenericMethod[T](T)");
Assert.That(ExpressionProcessor.Signature(thisMethod), Is.EqualTo("NHibernate.Test.Criteria.Lambda.ExpressionProcessorFixture:T GenericMethod[T](T)"));
}

[Test]
Expand All @@ -352,7 +352,7 @@ public void TestSignatureQualifiedGeneric()
Expression<Func<string>> expression = () => this.GenericMethod("test");
MethodInfo genericMethodWithQualifiedType = (expression.Body as MethodCallExpression).Method;

ExpressionProcessor.Signature(genericMethodWithQualifiedType).Should().Be("NHibernate.Test.Criteria.Lambda.ExpressionProcessorFixture:T GenericMethod[T](T)");
Assert.That(ExpressionProcessor.Signature(genericMethodWithQualifiedType), Is.EqualTo("NHibernate.Test.Criteria.Lambda.ExpressionProcessorFixture:T GenericMethod[T](T)"));
}

}
Expand Down
Loading