コード例 #1
0
ファイル: ActualDALTest.cs プロジェクト: chai/hakanai
        public void DeletePhotograph()
        {
            CreateANewPhotograph();

            var dbContextScopeFactory = new DbContextScopeFactory();
            var ambientDbContextLocator = new AmbientDbContextLocator();
            var photographRepository = new PhotographRepository(ambientDbContextLocator);

            var photographService = new PhotographServices(dbContextScopeFactory, photographRepository);
            //var userQueryService = new UserQueryService(dbContextScopeFactory, userRepository);
            //var userEmailService = new UserEmailService(dbContextScopeFactory);
            //var userCreditScoreService = new UserCreditScoreService(dbContextScopeFactory);

            Assert.IsTrue(photographService.RemovePhotography((new Photograph { PhotographId = Guid.Empty })));
        }
コード例 #2
0
ファイル: ActualDALTest.cs プロジェクト: chai/hakanai
        public void CreateANewPhotograph()
        {
            var dbContextScopeFactory = new DbContextScopeFactory();
            var ambientDbContextLocator = new AmbientDbContextLocator();
            var photographRepository = new PhotographRepository(ambientDbContextLocator);

            var photographService = new PhotographServices(dbContextScopeFactory, photographRepository);
            //var userQueryService = new UserQueryService(dbContextScopeFactory, userRepository);
            //var userEmailService = new UserEmailService(dbContextScopeFactory);
            //var userCreditScoreService = new UserCreditScoreService(dbContextScopeFactory);

                Photograph newPhoto = new Photograph();

                newPhoto.Location = "testlocation";

            Assert.IsTrue(photographService.UploadPhotography(newPhoto));

            Guid uploadID = newPhoto.PhotographId;
            Assert.IsTrue(photographService.RemovePhotography(newPhoto));
        }
コード例 #3
0
ファイル: ActualDALTest.cs プロジェクト: chai/hakanai
        public void GetAllPhotograph()
        {
            var dbContextScopeFactory = new DbContextScopeFactory();
            var ambientDbContextLocator = new AmbientDbContextLocator();
            var photographRepository = new PhotographRepository(ambientDbContextLocator);

            var photographService = new PhotographServices(dbContextScopeFactory, photographRepository);

            var photo = photographService.GetAllPhotographs();
            //foreach (var photograph in photo)
            //{
            //    var tempt = photograph.Title;

            //    foreach(var tempphot in photograph.Projects)
            //    {
            //        var t = tempphot.Title;

            //    }

            //}
            Assert.IsNotNull(photo);
        }
コード例 #4
0
ファイル: ActualDALTest.cs プロジェクト: chai/hakanai
        public void GetAPhotograph()
        {
            var dbContextScopeFactory = new DbContextScopeFactory();
            var ambientDbContextLocator = new AmbientDbContextLocator();
            var photographRepository = new PhotographRepository(ambientDbContextLocator);

            var photographService = new PhotographServices(dbContextScopeFactory, photographRepository);
            //var userQueryService = new UserQueryService(dbContextScopeFactory, userRepository);
            //var userEmailService = new UserEmailService(dbContextScopeFactory);
            //var userCreditScoreService = new UserCreditScoreService(dbContextScopeFactory);

            var photo = photographService.GetPhotograph(new Guid("9a1f9e3e-b389-e511-9c5a-00249b0905d8"));
               foreach (var photographInProject in photo.Projects)
            {
                foreach (var actualPhoto in photographInProject.Photographs)
                {

                    string a= actualPhoto.Title;
                }

            }

            var photo2 = photographService.GetPhotograph(new Guid("1a1f9e3e-b389-e511-9c5a-00249b0905d8"));
            Assert.IsNotNull(photo);
        }