Example #1
0
        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 })));
        }
Example #2
0
        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));
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }