private static void LoadTestCases(ISession session, ref long id, string filename)
		{
			XmlTestDocument document = new XmlTestDocument();
			document.LoadFile(filename);
			foreach (XmlTestCollection testCase in document.Tests)
			{
				foreach (XmlTest test in testCase)
				{
					NtsTestCase ntsTestCase = new NtsTestCase();
					switch (test.TestType)
					{
						case XmlTestType.Intersection:
						case XmlTestType.Union:
						case XmlTestType.Difference:
						case XmlTestType.SymmetricDifference:
						case XmlTestType.Boundary:
						case XmlTestType.Centroid:
						case XmlTestType.ConvexHull:
						case XmlTestType.Envelope:
						case XmlTestType.InteriorPoint:
							ntsTestCase.GeometryResult = (IGeometry)test.Result;
							break;
						case XmlTestType.Contains:
						case XmlTestType.CoveredBy:
						case XmlTestType.Covers:
						case XmlTestType.Crosses:
						case XmlTestType.Disjoint:
						case XmlTestType.Equals:
						case XmlTestType.Intersects:
						case XmlTestType.IsEmpty:
						case XmlTestType.IsSimple:
						case XmlTestType.IsValid:
						case XmlTestType.Touches:
						case XmlTestType.Within:
							ntsTestCase.BooleanResult = (bool)test.Result;
							break;
						case XmlTestType.Relate:
							ntsTestCase.RelatePattern = (string)test.Argument2;
							ntsTestCase.BooleanResult = (bool)test.Result;
							break;
						default:
							continue;
					}
					ntsTestCase.Operation = test.TestType.ToString();
					ntsTestCase.Description = testCase.Name + ": " + test.Description;

					if (test.IsDefaultTarget)
					{
						ntsTestCase.GeometryA = test.A;
						ntsTestCase.GeometryB = test.B;
					}
					else
					{
						ntsTestCase.GeometryA = test.B;
						ntsTestCase.GeometryB = test.A;
					}

					ntsTestCase.Id = ++id;

					Prepare(ntsTestCase);

					session.Save(ntsTestCase);
				}
			}
		}
		/// <summary>
		/// Prepares an entity for saving.
		/// </summary>
		/// <param name="ntsTestCase"></param>
		private static void Prepare(NtsTestCase ntsTestCase)
		{
			ntsTestCase.GeometryA = Prepare(ntsTestCase.GeometryA);
			ntsTestCase.GeometryB = Prepare(ntsTestCase.GeometryB);
			ntsTestCase.GeometryResult = Prepare(ntsTestCase.GeometryResult);
		}