Roger Kratz committed 9cac4e8

better tests for NHE-93 and removed ignored test for oracle

Comments (0)

Files changed (1)


 using System.Collections.Generic;
 using System.Linq;
-using NHibernate.Dialect;
 using NHibernate.Envers.Tests.Entities;
 using NUnit.Framework;
 using SharpTestsEx;
-		public void VerifyAuditRecordsRollback()
+		public void CommittedEntityShouldHaveAuditRecord()
-			if(Dialect is Oracle8iDialect)
-				Assert.Ignore("Fails due to NH Core issue");
-			AuditReader().GetRevisions(typeof (IntTestEntity), committedId).Count().Should().Be.EqualTo(1);
-			AuditReader().GetRevisions(typeof (IntTestEntity), rollbackId).Should().Be.Empty();
+			AuditReader().GetRevisions(typeof(IntTestEntity), committedId).Count().Should().Be.EqualTo(1);
+		}
+		[Test]
+		public void RollbackedEntityShouldHaveAuditRecordIfPersisted()
+		{
+			//NH might persist rollbacked entity
+			//
+			var revisions = AuditReader().GetRevisions(typeof (IntTestEntity), rollbackId);
+			var entity = Session.Get<IntTestEntity>(rollbackId);
+			if (entity == null)
+			{
+				revisions.Should().Be.Empty();
+			}
+			else
+			{
+				//if code generated poid, the session is still dirty when second transaction starts
+				// eg oracle dialects ends up here in this test
+				revisions.Count().Should().Be.EqualTo(1);
+			}
 		protected override IEnumerable<string> Mappings
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.