예제 #1
0
		public void SelectUsingProjectToWithNullComplexSourceProperty()
		{
			var customers = new[] { new Customer { FirstName = "Bill", LastName = "White" } }.AsQueryable();

			var projected = customers.Project().To<CustomerDto>().SingleOrDefault();
			projected.ShouldNotBeNull();
			projected.Address.ShouldBeNull();
		}
예제 #2
0
		public void ProjectToWithUnmappedTypeShouldThrowException()
		{
			var customers =
				new[] { new Customer { FirstName = "Bill", LastName = "White", Address = new Address("Street1") } }
					.AsQueryable();

			IList<Unmapped> projected = null;

            typeof(InvalidOperationException).ShouldBeThrownBy(() => projected = customers.Project().To<Unmapped>().ToList());

			projected.ShouldBeNull();
		}