Пример #1
0
        public void TestDelete()
        {
            ICareerService service = new CareerService(new CareerRepository(new MoviesContext()));
            var            career  = new Career {
                Id = Guid.NewGuid(), Title = "testDeleteCareer"
            };

            service.AddCareer(career);

            service.Delete(career.Id);

            var sameCareer = service.GetCareerById(career.Id);

            Assert.IsNull(sameCareer);
        }
Пример #2
0
        public void TestUpdate()
        {
            ICareerService service = new CareerService(new CareerRepository(new MoviesContext()));
            var            career  = new Career {
                Id = Guid.NewGuid(), Title = "testUpdateCareer"
            };

            service.AddCareer(career);

            career.Title = "UpdatedCareer";
            service.Edit(career);
            var sameCareer = service.GetCareerById(career.Id);

            Assert.AreSame(career.Title, sameCareer.Title);

            service.Delete(career.Id);
        }