コード例 #1
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));
        }
コード例 #2
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 })));
        }