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(); }
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(); }