Репозиторий людей.
Inheritance: IPersonRepository
コード例 #1
0
ファイル: PersonRepositoryTest.cs プロジェクト: dha01/IS
        public void SetUp()
        {
            _transactionScope = new TransactionScope();
            _personRepository = new PersonRepository();

            _person = new PersonItem()
            {
                Id = 1,
                LastName = "Иванов",
                FirstName = "Василий",
                Birthday = DateTime.Now.Date,
                FatherName = "Иванович"

            };
            _personNew = new PersonItem()
            {
                Id = 1,
                LastName = "Пупкин",
                FirstName = "Сергей",
                Birthday = DateTime.Now.Date,
                FatherName = "Петрович"
            };
        }
コード例 #2
0
ファイル: StudentRepositoryTests.cs プロジェクト: dha01/IS
        public void SetUp()
        {
            _transactionScope = new TransactionScope();
            _studentRepository = new StudentRepository();
            _personRepository = new PersonRepository();
            _teamRepository = new TeamRepository();
            _specialtyDetailRepository = new SpecialtyDetailRepository();
            _specialtyRepository = new SpecialtyRepository();
            _cathedraRepository = new CathedraRepository();
            _facultyRepository = new FacultyRepository();

            _team = new TeamItem()
            {
                CreateDate = DateTime.Now,
                Name = "ПЕ-22б",
                SpecialtyDetailId = _specialtyDetailRepository.Create(new SpecialtyDetailItem()
                {
                    SpecialtyId = _specialtyRepository.Create(new SpecialtyItem()
                    {
                        CathedraId = _cathedraRepository.Create(new CathedraItem()
                        {
                            FacultyId = _facultyRepository.Create(new FacultyItem()),
                            FullName = "Кафедра",
                            ShortName = "K"
                        }),
                        FullName = "Специальность",
                        ShortName = "С",
                        Code = "1"
                    }),
                    ActualDate = DateTime.Now
                })
            };

            _student = new StudentItem()
            {
                LastName = "Егоров",
                FirstName = "Виталий",
                FatherName = "Игоревич",
                Birthday = DateTime.Now,
                TeamId = _teamRepository.Create(_team)
            };
            _student.Id = _personRepository.Create(_student);

            _studentNew = new StudentItem()
            {
                LastName = "Журавлев",
                FirstName = "Данил",
                FatherName = "Александрович",
                Birthday = DateTime.Now,
                TeamId = _teamRepository.Create(_team)
            };
            _studentNew.Id = _personRepository.Create(_student);
        }
コード例 #3
0
ファイル: CommentRepositoryTests.cs プロジェクト: dha01/IS
        public void SetUp()
        {
            _transactionScope = new TransactionScope();
            _commentRepository = new CommentRepository();
            _personRepository = new PersonRepository();
            _taskRepository = new TaskRepository();

            first_person = new PersonItem()
            {
                LastName = "Никонов",
                FirstName = "Денис",
                Birthday = DateTime.Now.Date,
                FatherName = "Олегович"
            };

            second_person = new PersonItem()
            {
                LastName = "Кажин",
                FirstName = "Филипп",
                Birthday = DateTime.Now.AddMonths(-3).Date,
                FatherName = "Александрович"
            };

            first_task = new TaskItem()
            {
                Author = "1",
                Deadline = DateTime.Now.AddDays(7).Date,
                Created = DateTime.Now.Date,
                Performer = "1",
                Header = "Тестирование демонстрационной задачи",
                IsOpen = true,
                IsPerform = false,
                Mem = "Описание",
                Number = 1,
                Priority = 0,
                Prefix = TaskPrefix.Refactoring
            };

            second_task = new TaskItem()
            {
                Author = "2",
                Deadline = DateTime.Now.AddDays(8).Date,
                Created = DateTime.Now.Date,
                Performer = "2",
                Header = "Тестирование демонстрационной задачи 2",
                IsOpen = false,
                IsPerform = true,
                Mem = "Описание2",
                Number = 2,
                Priority = 5,
                Prefix = TaskPrefix.Demo
            };

            _comment = new CommentItem()
            {
                AddDate = DateTime.Now.Date,
                PersonId = _personRepository.Create(first_person),
                Text = "Задача номер 1",
                TaskId = _taskRepository.Create(first_task)
            };
            _commentNew = new CommentItem()
            {
                AddDate = DateTime.Now.AddYears(-1).Date,
                PersonId = _personRepository.Create(second_person),
                Text = "Задача номер 2",
                TaskId = _taskRepository.Create(second_task)
            };
        }
コード例 #4
0
ファイル: LecturerRepositoryTest.cs プロジェクト: dha01/IS
        public void SetUp()
        {
            _transactionScope = new TransactionScope();
            _lecturerRepository = new LecturerRepository();
            _cathedraRepository = new CathedraRepository();
            _facultyRepository = new FacultyRepository();
            _personRepository = new PersonRepository();

            _faculty = new FacultyItem()
            {
                FullName = "Информационный",
                ShortName = "И",
            };

            _cathedra = new CathedraItem()
            {
                FullName = "Информациионных систем и технологий",
                ShortName = "ИСиТ",
                FacultyId = _facultyRepository.Create(_faculty)
            };

            _person = new PersonItem()
            {
                Birthday = DateTime.Now.AddDays(2).Date,
                FatherName = "Сидорович",
                FirstName = "Сидор",
                LastName = "Сидоров",
            };

            _lecturer = new LecturerItem()
            {
                CathedraId = _cathedraRepository.Create(_cathedra),
                Birthday = _person.Birthday,
                FatherName = _person.FatherName,
                FirstName = _person.FirstName,
                Id = _personRepository.Create(_person),
                LastName = _person.LastName,
            };

            _personNew = new PersonItem()
            {
                Birthday = DateTime.Now.AddDays(3).Date,
                FatherName = "Петрович",
                FirstName = "Петр",
                LastName = "Петров",
            };
            _lecturerNew = new LecturerItem()
            {
                CathedraId = _cathedraRepository.Create(_cathedra),
                Birthday = _personNew.Birthday,
                FatherName = _personNew.FatherName,
                FirstName = _personNew.FirstName,
                Id = _personRepository.Create(_person),
                LastName = _personNew.LastName
            };
        }