NUnit.Framework.Assert.Ignore()

Here are the examples of the csharp api class NUnit.Framework.Assert.Ignore() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

168 Examples 7

1. Example

Project: nhibernate-core
Source File: Fixture.cs
View license
[Test]
		public void MultiCriteriaShouldThrowUserExceptionAsync()
		{
			var driver = Sfi.ConnectionProvider.Driver;
			if (!driver.SupportsMultipleQueries)
				Assert.Ignore("Driver {0} does not support multi-queries", driver.GetType().FullName);

			using (var s = OpenSession())
			using (s.BeginTransaction())
			{
				var multi = s.CreateMultiCriteria();
				multi.Add(s.CreateCriteria(typeof (ClassA)));
				s.Connection.Close();
				Assert.ThrowsAsync<UnitTestException>(() => multi.ListAsync());
			}
		}

2. Example

Project: nhibernate-core
Source File: FutureFixture.cs
View license
protected void IgnoreThisTestIfMultipleQueriesArentSupportedByDriver()
		{
			var driver = Sfi.ConnectionProvider.Driver;
			if (driver.SupportsMultipleQueries == false)
				Assert.Ignore("Driver {0} does not support multi-queries", driver.GetType().FullName);
		}

3. Example

Project: nhibernate-core
Source File: LinqQuerySamples.cs
View license
[Category("JOIN")]
		[Test(Description = "This sample explictly joins two tables and projects results from both tables using a group join.")]
		public void DLinqJoin5()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

			var q =
				from c in db.Customers 
				join o in db.Orders on c.CustomerId equals o.Customer.CustomerId into orders
				select new {c.ContactName, OrderCount = orders.Average(x => x.Freight)};

			ObjectDumper.Write(q);
		}

4. Example

Project: nhibernate-core
Source File: FixtureByCode.cs
View license
void AssertDialect()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType() + " does not support this type of query");
		}

5. Example

Project: nhibernate-core
Source File: Fixture.cs
View license
[Test]
		public void MultiQuerySingleInList()
		{
			var driver = Sfi.ConnectionProvider.Driver;
			if (!driver.SupportsMultipleQueries)
				Assert.Ignore("Driver {0} does not support multi-queries", driver.GetType().FullName);

			using (var s = OpenSession())
			using (var tx = s.BeginTransaction())
			{
				var results = s.CreateMultiQuery()
					.Add("from Car c where c.Make in (:param1) or c.Model in (:param11)")
					.Add("from Car c where c.Make in (:param1) or c.Model in (:param11)")
					.SetParameterList("param11", new string[] {"Model1", "Model2"})
					.SetParameterList("param1", new string[] {"Make1", "Make2"})
					.List();

				tx.Commit();
			}
		}

6. Example

Project: nhibernate-core
Source File: LinqQuerySamples.cs
View license
[Category("SELECT/DISTINCT")]
		[Test(Description = "This sample uses SELECT and anonymous types to return " +
							"a shaped subset of the data about Customers.")]
		public void DLinq16()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

			var q =
				from c in db.Customers
				select new
						   {
							   c.CustomerId,
							   CompanyInfo = new {c.CompanyName, c.Address.City, c.Address.Country},
							   ContactInfo = new {c.ContactName, c.ContactTitle},
							   Count = c.Orders.Count()
						   };

			ObjectDumper.Write(q, 1);
		}

7. Example

Project: nhibernate-core
Source File: MathTests.cs
View license
private void IgnoreIfNotSupported(string function)
		{
			if (!Dialect.Functions.ContainsKey(function))
				Assert.Ignore("Dialect {0} does not support '{1}' function", Dialect.GetType(), function);
		}

8. Example

Project: nhibernate-core
Source File: LinqQuerySamples.cs
View license
[Category("JOIN")]
		[Test(Description = "This sample explictly joins three tables and projects results from each of them.")]
		public void DLinqJoin6()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

			var q =
				from c in db.Customers
				join o in db.Orders on c.CustomerId equals o.Customer.CustomerId into ords
				join e in db.Employees on c.Address.City equals e.Address.City into emps
				select new {c.ContactName, ords = ords.Count(), emps = emps.Count()};

			ObjectDumper.Write(q);
		}

9. Example

Project: nhibernate-core
Source File: FixtureByCode.cs
View license
void AssertDialect()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType() + " does not support this type of query");
		}

10. Example

Project: nhibernate-core
Source File: Fixture.cs
View license
[Test]
		public void MultiHqlShouldThrowUserExceptionAsync()
		{
			var driver = Sfi.ConnectionProvider.Driver;
			if (!driver.SupportsMultipleQueries)
				Assert.Ignore("Driver {0} does not support multi-queries", driver.GetType().FullName);

			using (var s = OpenSession())
			using (s.BeginTransaction())
			{
				var multi = s.CreateMultiQuery();
				multi.Add(hqlQuery);
				s.Connection.Close();
				Assert.ThrowsAsync<UnitTestException>(() => multi.ListAsync());
			}
		}

11. Example

Project: nhibernate-core
Source File: Fixture.cs
View license
[Test]
		public async Task MultiQuerySingleInListAsync()
		{
			var driver = Sfi.ConnectionProvider.Driver;
			if (!driver.SupportsMultipleQueries)
				Assert.Ignore("Driver {0} does not support multi-queries", driver.GetType().FullName);

			using (var s = OpenSession())
			using (var tx = s.BeginTransaction())
			{
				var results = await (s.CreateMultiQuery()
					.Add("from Car c where c.Make in (:param1) or c.Model in (:param11)")
					.Add("from Car c where c.Make in (:param1) or c.Model in (:param11)")
					.SetParameterList("param11", new string[] {"Model1", "Model2"})
					.SetParameterList("param1", new string[] {"Make1", "Make2"})
					.ListAsync());

				await (tx.CommitAsync());
			}
		}

12. Example

Project: nunitlite
Source File: AssertIgnoreTests.cs
View license
[Test, ExpectedException(typeof(IgnoreException))]
        public void ThrowsIgnoreException()
        {
            Assert.Ignore();
        }

13. Example

View license
public override void TestFixtureSetUp()
        {
            var rslt = client.GetBucketProperties(BucketType, Bucket);
            if (rslt.IsSuccess == false)
            {
                Assert.Ignore("{0} bucket type not present. Ignoring suite.", BucketType);
            }
        }

14. Example

View license
public override void TestFixtureSetUp()
        {
            var rslt = client.GetBucketProperties(BucketType, Bucket);
            if (rslt.IsSuccess == false)
            {
                Assert.Ignore("{0} bucket type not present. Ignoring suite.", BucketType);
            }
        }

15. Example

View license
public static void CheckMono()
        {
#pragma warning disable 0618 // Mono recommends to do this.
            if (!SecurityManager.SecurityEnabled)
                Assert.Ignore("SecurityManager.SecurityEnabled is OFF");
#pragma warning restore 0618
            if (IsRunningOnMono())
                Assert.Ignore("IsolatedRazorEngineServiceTestFixture is not supported on mono");
        }

16. Example

Project: Mobius
Source File: SocketWrapperTest.cs
View license
[Test]
        public void TestUseSingleThreadForRioNative()
        {
            if (!SocketFactory.IsRioSockSupported())
            {
                Assert.Ignore("Omitting due to missing Riosock.dll. It might caused by no VC++ build tool or running on an OS that not supports Windows RIO socket.");
            }

            RioNative.SetUseThreadPool(false);
            RioNative.EnsureRioLoaded();
            Assert.AreEqual(1, RioNative.GetWorkThreadNumber());
            RioNative.UnloadRio();
        }

17. Example

Project: Mobius
Source File: SocketWrapperTest.cs
View license
[Test]
        public void TestUseThreadPoolForRioNative()
        {
            if (!SocketFactory.IsRioSockSupported())
            {
                Assert.Ignore("Omitting due to missing Riosock.dll. It might caused by no VC++ build tool or running on an OS that not supports Windows RIO socket.");
            }

            // Verify default value for no specific executor cores in environment variable.
            RioNative.SetUseThreadPool(true);
            RioNative.EnsureRioLoaded();
            Assert.AreEqual(2, RioNative.GetWorkThreadNumber());
            RioNative.UnloadRio();
            RioNative.SetUseThreadPool(false);

            // Verify the executor cores is less than 2.
            Environment.SetEnvironmentVariable(ConfigurationService.ExecutorCoresEnvName, "1");
            RioNative.SetUseThreadPool(true);
            RioNative.EnsureRioLoaded();
            Assert.AreEqual(2, RioNative.GetWorkThreadNumber());
            RioNative.UnloadRio();
            RioNative.SetUseThreadPool(false);

            // Verify the executor cores is more than 2.
            Environment.SetEnvironmentVariable(ConfigurationService.ExecutorCoresEnvName, "5");
            RioNative.SetUseThreadPool(true);
            RioNative.EnsureRioLoaded();
            Assert.AreEqual(3, RioNative.GetWorkThreadNumber());
            RioNative.UnloadRio();
            RioNative.SetUseThreadPool(false);
        }

18. Example

Project: nhibernate-core
Source File: SelectionTests.cs
View license
[Test]
		public void CanSelectWithAggregateSubQuery()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

			var timesheets = (from timesheet in db.Timesheets
							  select new
							  {
								  timesheet.Id,
								  EntryCount = timesheet.Entries.Count
							  }).ToArray();

			Assert.AreEqual(3, timesheets.Length);
			Assert.AreEqual(0, timesheets[0].EntryCount);
			Assert.AreEqual(2, timesheets[1].EntryCount);
			Assert.AreEqual(4, timesheets[2].EntryCount);
		}

19. Example

Project: nhibernate-core
Source File: Fixture.cs
View license
[Test]
		public void MultiCriteriaShouldThrowUserException()
		{
			var driver = Sfi.ConnectionProvider.Driver;
			if (!driver.SupportsMultipleQueries)
				Assert.Ignore("Driver {0} does not support multi-queries", driver.GetType().FullName);

			using (var s = OpenSession())
			using (s.BeginTransaction())
			{
				var multi = s.CreateMultiCriteria();
				multi.Add(s.CreateCriteria(typeof (ClassA)));
				s.Connection.Close();
				Assert.Throws<UnitTestException>(() => multi.List());
			}
		}

20. Example

Project: nhibernate-core
Source File: LinqQuerySamples.cs
View license
[Category("SELECT/DISTINCT")]
		[Test(Description = "This sample uses SELECT and anonymous types to return " +
							"a shaped subset of the data about Customers.")]
		public Task DLinq16Async()
		{
			try
			{
				if (!Dialect.SupportsScalarSubSelects)
					Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

				var q =
				from c in db.Customers
				select new
						   {
							   c.CustomerId,
							   CompanyInfo = new {c.CompanyName, c.Address.City, c.Address.Country},
							   ContactInfo = new {c.ContactName, c.ContactTitle},
							   Count = c.Orders.Count()
						   };

				return ObjectDumper.WriteAsync(q, 1);
			}
			catch (Exception ex)
			{
				return Task.FromException<object>(ex);
			}
		}

21. Example

Project: nhibernate-core
Source File: LinqQuerySamples.cs
View license
[Category("JOIN")]
		[Test(Description = "This sample explictly joins two tables and projects results from both tables using a group join.")]
		public Task DLinqJoin5Async()
		{
			try
			{
				if (!Dialect.SupportsScalarSubSelects)
					Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

				var q =
				from c in db.Customers 
				join o in db.Orders on c.CustomerId equals o.Customer.CustomerId into orders
				select new {c.ContactName, OrderCount = orders.Average(x => x.Freight)};

				return ObjectDumper.WriteAsync(q);
			}
			catch (Exception ex)
			{
				return Task.FromException<object>(ex);
			}
		}

22. Example

Project: nhibernate-core
Source File: LinqQuerySamples.cs
View license
[Category("JOIN")]
		[Test(Description = "This sample explictly joins three tables and projects results from each of them.")]
		public Task DLinqJoin6Async()
		{
			try
			{
				if (!Dialect.SupportsScalarSubSelects)
					Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

				var q =
				from c in db.Customers
				join o in db.Orders on c.CustomerId equals o.Customer.CustomerId into ords
				join e in db.Employees on c.Address.City equals e.Address.City into emps
				select new {c.ContactName, ords = ords.Count(), emps = emps.Count()};

				return ObjectDumper.WriteAsync(q);
			}
			catch (Exception ex)
			{
				return Task.FromException<object>(ex);
			}
		}

23. Example

Project: nhibernate-core
Source File: Fixture.cs
View license
[Test]
		public void MultiHqlShouldThrowUserException()
		{
			var driver = Sfi.ConnectionProvider.Driver;
			if (!driver.SupportsMultipleQueries)
				Assert.Ignore("Driver {0} does not support multi-queries", driver.GetType().FullName);

			using (var s = OpenSession())
			using (s.BeginTransaction())
			{
				var multi = s.CreateMultiQuery();
				multi.Add(hqlQuery);
				s.Connection.Close();
				Assert.Throws<UnitTestException>(() => multi.List());
			}
		}

24. Example

Project: Mobius
Source File: ByteBufChunkTest.cs
View license
[Test]
        public void TestAllocateFreeUnsafeBufChunk()
        {
            if (!SocketFactory.IsRioSockSupported())
            {
                Assert.Ignore("Omitting due to missing Riosock.dll. It might caused by no VC++ build tool or running on an OS that not supports Windows RIO socket.");
            }
            // This chunk can only allocate 4 ByteBufs totally
            var chunk = ByteBufChunk.NewChunk(unsafeBufPool, unsafeBufPool.SegmentSize, unsafeBufPool.ChunkSize, true);
            Assert.AreNotEqual(IntPtr.Zero, chunk.BufId);
            AllocateFreeBufChunkTest(chunk);
            chunk.Dispose();
        }

25. Example

Project: Mobius
Source File: SocketWrapperTest.cs
View license
[Test]
        public void TestRioSocket()
        {
            if (!SocketFactory.IsRioSockSupported())
            {
                Assert.Ignore("Omitting due to missing Riosock.dll. It might caused by no VC++ build tool or running on an OS that not supports Windows RIO socket.");
            }

            // Set Socket wrapper to Rio
            Environment.SetEnvironmentVariable(ConfigurationService.CSharpSocketTypeEnvName, "Rio");
            SocketFactory.SocketWrapperType = SocketWrapperType.None;
            RioSocketWrapper.rioRqGrowthFactor = 1;
            var serverSocket = SocketFactory.CreateSocket();
            Assert.IsTrue(serverSocket is RioSocketWrapper);
            SocketTest(serverSocket);
            
            // Reset socket wrapper type
            Environment.SetEnvironmentVariable(ConfigurationService.CSharpSocketTypeEnvName, string.Empty);
            SocketFactory.SocketWrapperType = SocketWrapperType.None;
            RioNative.UnloadRio();
        }

26. Example

Project: Mobius
Source File: ByteBufTest.cs
View license
[Test]
        public void TestWriteReadUnsafeBuf()
        {
            if (!SocketFactory.IsRioSockSupported())
            {
                Assert.Ignore("Omitting due to missing Riosock.dll. It might caused by no VC++ build tool or running on an OS that not supports Windows RIO socket.");
            }

            var byteBuf = unsafeBufPool.Allocate();
            Assert.AreNotEqual(IntPtr.Zero, byteBuf.UnsafeArray); // Verify the point of UnsafeArray has value on unsafe buffer.
            WriteReadByteBufTest(byteBuf);
            byteBuf.Release();
        }

27. Example

View license
[Test]
		public async Task TimeSheetsWithMinSubqueryComparedToPropertyReversedAsync()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

			var query = await ((from timesheet in db.Timesheets
						 where timesheet.Id < timesheet.Entries.Min(e => e.NumberOfHours)
						 select timesheet).ToListAsync());

			Assert.That(query.Count, Is.EqualTo(2));
		}

28. Example

View license
[Test(Description = "NH-3111")]
		public void SubqueryWhereFailingTest3()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support subquery in select clause");

			var list = db.OrderLines
				.Select(ol => new
				{
					ol.Discount,
					ShipperPhoneNumber = db.Orders
						.Where(sh => sh.Shipper.ShipperId == ol.Order.Shipper.ShipperId)
						.Select(sh => sh.Shipper.PhoneNumber)
						.FirstOrDefault()
				}).ToList();

			Assert.That(list.Count, Is.EqualTo(2155));
		}

29. Example

View license
[Test]
		public void TimeSheetsWithSumSubquery()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

			var query = (from timesheet in db.Timesheets
						 where timesheet.Entries.Sum(e => e.NumberOfHours) <= 20
						 select timesheet).ToList();

			Assert.That(query.Count, Is.EqualTo(1));
		}

30. Example

View license
[Test]
		public async Task TimeSheetsWithCountSubqueryComparedToPropertyAsync()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

			var query = await ((from timesheet in db.Timesheets
						 where timesheet.Entries.Count() > timesheet.Id
						 select timesheet).ToListAsync());

			Assert.That(query.Count, Is.EqualTo(1));
		}

31. Example

View license
[Test]
		public async Task TimeSheetsWithMaxSubqueryComparedToPropertyAsync()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

			var query = await ((from timesheet in db.Timesheets
						 where timesheet.Entries.Max(e => e.NumberOfHours) > timesheet.Id
						 select timesheet).ToListAsync());

			Assert.That(query.Count, Is.EqualTo(2));
		}

32. Example

View license
[Test]
		public void TimeSheetsWithMinSubqueryReversed()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

			var query = (from timesheet in db.Timesheets
						 where 7 > timesheet.Entries.Min(e => e.NumberOfHours)
						 select timesheet).ToList();

			Assert.That(query.Count, Is.EqualTo(2));
		}

33. Example

View license
[Test(Description = "NH-3111")]
		public async Task SubqueryWhereFailingTestAsync()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support subquery in select clause");

			var list = await ((db.OrderLines
				.Select(ol => new
				{
					ol.Discount,
					ShipperPhoneNumber = db.Shippers
						.Where(sh => sh.ShipperId == ol.Order.Shipper.ShipperId)
						.Select(sh => sh.PhoneNumber)
						.FirstOrDefault()
				})).ToListAsync());

			Assert.That(list.Count, Is.EqualTo(2155));
		}

34. Example

View license
[Category("From NHUser list")]
        [Test(Description = "Predicated count on a child list")]
        public async Task PredicatedCountOnChildListAsync()
        {
            if (!Dialect.SupportsScalarSubSelects)
                Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

            var results = await ((from c in db.Customers
                           select new
                                      {
                                          c.ContactName,
                                          Count = c.Orders.Count(o => o.Employee.EmployeeId == 4)
                                      }).ToListAsync());

            Assert.AreEqual(91, results.Count());
            Assert.AreEqual(2, results.Where(c => c.ContactName == "Maria Anders").Single().Count);
            Assert.AreEqual(4, results.Where(c => c.ContactName == "Thomas Hardy").Single().Count);
            Assert.AreEqual(0, results.Where(c => c.ContactName == "Elizabeth Brown").Single().Count);
        }

35. Example

Project: nhibernate-core
Source File: GroupByTests.cs
View license
[Test(Description = "NH-3844")]
		public async Task GroupByComputedValueFromNestedArraySelectAsync()
		{
			if (!TestDialect.SupportsComplexExpressionInGroupBy)
				Assert.Ignore(Dialect.GetType().Name + " does not support complex group by expressions");
			if (Sfi.ConnectionProvider.Driver is OdbcDriver)
				Assert.Ignore("SQL Server seems unable to match complex group by and select list arguments when running over ODBC.");

			var orderGroups = await (db.OrderLines.Select(o => new object[] { o }).GroupBy(x => new object[] { ((OrderLine)x[0]).Order.Customer == null ? 0 : 1 }).Select(g => new { Key = g.Key, Count = g.Count() }).ToListAsync());
			Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
		}

36. Example

Project: nhibernate-core
Source File: SelectionTests.cs
View license
[Test]
		public void CanSelectConditionalKnownTypes()
		{
			if (!Dialect.SupportsScalarSubSelects)
/n ..... /n //View Source file for more details /n }

37. Example

View license
[Test]
		[Ignore("Need to coalesce the subquery - timesheet with no entries should return average of 0, not null")]
		public void TimeSheetsWithAverageSubqueryComparedToProperty()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

			var query = (from timesheet in db.Timesheets
						 where timesheet.Entries.Average(e => e.NumberOfHours) < timesheet.Id
						 select timesheet).ToList();

			Assert.That(query.Count, Is.EqualTo(1));
		}

38. Example

View license
[Test(Description = "NH-3111")]
		public async Task SubqueryWhereFailingTest2Async()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support subquery in select clause");

			var list = await (db.OrderLines
				.Select(ol => new
				{
					ol.Discount,
					ShipperPhoneNumber = db.Shippers
						.Where(sh => sh == ol.Order.Shipper)
						.Select(sh => sh.PhoneNumber)
						.FirstOrDefault()
				}).ToListAsync());

			Assert.That(list.Count, Is.EqualTo(2155));
		}

39. Example

View license
[Test]
		[Ignore("Need to coalesce the subquery - timesheet with no entries should return average of 0, not null")]
		public async Task TimeSheetsWithAverageSubqueryComparedToPropertyReversedAsync()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

			var query = await ((from timesheet in db.Timesheets
						 where timesheet.Id > timesheet.Entries.Average(e => e.NumberOfHours)
						 select timesheet).ToListAsync());

			Assert.That(query.Count, Is.EqualTo(1));
		}

40. Example

View license
[Test]
		public void TimeSheetsWithSumSubqueryReversed()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

			var query = (from timesheet in db.Timesheets
						 where 20 >= timesheet.Entries.Sum(e => e.NumberOfHours)
						 select timesheet).ToList();

			Assert.That(query.Count, Is.EqualTo(1));
		}

41. Example

Project: nhibernate-core
Source File: GroupByTests.cs
View license
[Test(Description = "NH-3801")]
		public async Task GroupByComputedValueWithJoinOnObjectAsync()
		{
			if (!TestDialect.SupportsComplexExpressionInGroupBy)
				Assert.Ignore(Dialect.GetType().Name + " does not support complex group by expressions");
			if (Sfi.ConnectionProvider.Driver is OdbcDriver)
				Assert.Ignore("SQL Server seems unable to match complex group by and select list arguments when running over ODBC.");

			var orderGroups = await (db.OrderLines.GroupBy(o => o.Order.Customer == null ? 0 : 1).Select(g => new { Key = g.Key, Count = g.Count() }).ToListAsync());
			Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
		}

42. Example

View license
[Test]
		public void ShouldBeMoneyType()
		{
			if (!(Dialect is MsSql2000Dialect))
			{
				Assert.Ignore("This test does not apply to " + Dialect);
			}
			var sqlType = Dialect.GetTypeName(NHibernateUtil.Currency.SqlType);
			Assert.That(sqlType, Is.EqualTo("MONEY"));
		}

43. Example

View license
[Test]
		public async Task TimeSheetsWithCountSubqueryComparedToPropertyReversedAsync()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

			var query = await ((from timesheet in db.Timesheets
						 where timesheet.Id < timesheet.Entries.Count()
						 select timesheet).ToListAsync());

			Assert.That(query.Count, Is.EqualTo(1));
		}

44. Example

View license
[Test(Description = "NH-3190")]
		[Ignore("Not fixed yet.")]
		public void ProductsWithSubqueryReturningProjectionBoolFirstOrDefaultEq()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

			//NH-3190
			var result = (from p in db.Products
						  where (from c in db.Categories
								 where c.Name == "Confections"
								 && c == p.Category
								 select new{R=p.Discontinued}).FirstOrDefault().R == false
						  select p)
				.ToList();

			Assert.That(result.Count, Is.EqualTo(13));
		}

45. Example

View license
[Test]
		[Ignore("Need to coalesce the subquery - timesheet with no entries should return average of 0, not null")]
		public async Task TimeSheetsWithAverageSubqueryComparedToPropertyAsync()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

			var query = await ((from timesheet in db.Timesheets
						 where timesheet.Entries.Average(e => e.NumberOfHours) < timesheet.Id
						 select timesheet).ToListAsync());

			Assert.That(query.Count, Is.EqualTo(1));
		}

46. Example

View license
[Test(Description = "NH-3111")]
		public void SubqueryWhereFailingTest()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support subquery in select clause");

			var list = (db.OrderLines
				.Select(ol => new
				{
					ol.Discount,
					ShipperPhoneNumber = db.Shippers
						.Where(sh => sh.ShipperId == ol.Order.Shipper.ShipperId)
						.Select(sh => sh.PhoneNumber)
						.FirstOrDefault()
				})).ToList();

			Assert.That(list.Count, Is.EqualTo(2155));
		}

47. Example

Project: nhibernate-core
Source File: GroupByTests.cs
View license
[Test(Description = "NH-3801, NH-4062")]
		public async Task GroupByComputedValueInObjectArrayWithJoinInRightSideOfCaseAsync()
		{
			if (!TestDialect.SupportsComplexExpressionInGroupBy)
				Assert.Ignore(Dialect.GetType().Name + " does not support complex group by expressions");
			if (Sfi.ConnectionProvider.Driver is OdbcDriver)
				Assert.Ignore("SQL Server seems unable to match complex group by and select list arguments when running over ODBC.");

			var orderGroups = await (db.OrderLines.GroupBy(o => new[] { o.Order.Customer.CustomerId == null ? "unknown" : o.Order.Customer.CompanyName }).Select(g => new { Key = g.Key, Count = g.Count() }).ToListAsync());
			Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
		}

48. Example

Project: nhibernate-core
Source File: DateTypeTest.cs
View license
[Test]
		public void ShouldBeDateType()
		{
			if (!(Dialect is MsSql2008Dialect))
			{
				Assert.Ignore("This test does not apply to " + Dialect);
			}
			var sqlType = Dialect.GetTypeName(Type.SqlType);
			Assert.That(sqlType.ToLowerInvariant(), Is.EqualTo("date"));
		}

49. Example

View license
[Test]
		[Ignore("Need to coalesce the subquery - timesheet with no entries should return sum of 0, not null")]
		public void TimeSheetsWithSumSubqueryComparedToProperty()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

			var query = (from timesheet in db.Timesheets
						 where timesheet.Entries.Sum(e => e.NumberOfHours) <= timesheet.Id
						 select timesheet).ToList();

			Assert.That(query.Count, Is.EqualTo(1));
		}

50. Example

View license
[Test(Description = "NH-3190")]
		[Ignore("Not fixed yet.")]
		public async Task ProductsWithSubqueryReturningProjectionBoolFirstOrDefaultEqAsync()
		{
			if (!Dialect.SupportsScalarSubSelects)
				Assert.Ignore(Dialect.GetType().Name + " does not support scalar sub-queries");

			//NH-3190
			var result = await ((from p in db.Products
						  where (from c in db.Categories
								 where c.Name == "Confections"
								 && c == p.Category
								 select new{R=p.Discontinued}).FirstOrDefault().R == false
						  select p)
				.ToListAsync());

			Assert.That(result.Count, Is.EqualTo(13));
		}