コード例 #1
0
        public void maps_provider_profile_dto()
        {
            using (var context = _objectContextFactory.CreateObjectContext())
            {
                context.ContextOptions.LazyLoadingEnabled = true;
                context.ContextOptions.ProxyCreationEnabled = true;
                var provider = context.CreateObjectSet<Provider>().Single(p => p.Id == _providerId);

                var mapper = new ProviderMapper(provider);

                var providerProfile = mapper.ToProfileDto();

                Assert.IsNotNull(providerProfile);

                AssertCustomPropertiesMapped(providerProfile);
            }
        }
コード例 #2
0
        public void maps_search_result()
        {
            using (var context = _objectContextFactory.CreateObjectContext())
            {
                context.ContextOptions.LazyLoadingEnabled = true;
                context.ContextOptions.ProxyCreationEnabled = true;
                var provider = context.CreateObjectSet<Provider>().Single(p => p.Id == _providerId);

                var mapper = new ProviderMapper(provider);

                var searchResult = mapper.ToSearchResult(_truncateLength);

                Assert.IsNotNull(searchResult);

                AssertCustomPropertiesMapped(searchResult);
                AssertPhilosophyOfCareTruncated(searchResult);
            }
        }