Esempio n. 1
0
        public async Task <IActionResult> List(StudentFilterViewModel studentFilterViewModel)
        {
            var studentListViewModel = new StudentListViewModel();

            var studentListResult = await _studentManager.GetList(_mapper.Map <StudentFilterModel>(studentFilterViewModel));

            if (studentListResult.IsOk)
            {
                var students = _mapper.Map <List <StudentMvcDto> >(studentListResult.Data.Students);
                studentListViewModel.Students = students;
            }

            var timeTextResult = await _studentManager.GetCachedData();

            studentListViewModel.TimeText      = timeTextResult.Data;
            studentListViewModel.ReturnMessage = Resource.OperationCompletedSuccessfully;


            studentFilterViewModel.Genders = await _optionManager.GetGenders();

            var result = (StudentListViewModel : studentListViewModel,
                          StudentFilterViewModel : studentFilterViewModel);


            return(View(result));
        }
Esempio n. 2
0
        public async Task Student_kaydedildiginde_ekrana_basasrili_mesaji_donmeli(string successfullMessage)
        {
            //Arrange
            var genders = await _optionManager.GetGenders();

            var formData = new Dictionary <string, string>
            {
                { "Student.Id", "" },
                { "Student.FirstName", "Firstname" },
                { "Student.LastName", "Lastname" },
                { "Student.BirthDate", "11/11/1996" },
                { "Student.StudentId", "2345678" },
                { "Student.Gender", "Male" },
                { "Student.Age", "20" }
            };

            //Act
            var response = await _client.PostAsync("/Student/AddUpdate", new FormUrlEncodedContent(formData));

            response.EnsureSuccessStatusCode();
            var responseString = await response.Content.ReadAsStringAsync();

            //Assert
            Assert.Contains(successfullMessage, responseString);
        }
        public async Task <IActionResult> List([FromForm] TeacherFilterViewModel teacherFilterViewModel)
        {
            var teacherListViewModel = new TeacherListViewModel();

            var teacherListResult = await _teacherManager.GetList(_mapper.Map <TeacherFilterModel>(teacherFilterViewModel));

            if (teacherListResult.IsOk)
            {
                var teachers = _mapper.Map(teacherListResult.Data.Teachers, new List <TeacherMvcDto>());
                teacherListViewModel.Teachers = teachers;
            }

            var timeTextResult = await _teacherManager.GetCachedData();

            teacherFilterViewModel.Genders = await _optionManager.GetGenders();

            teacherListViewModel.TimeText      = timeTextResult.Data;
            teacherListViewModel.ReturnMessage = Resource.OperationCompletedSuccessfully;

            ViewBag.TeacherFilterViewModel = teacherFilterViewModel;

            return(View(teacherListViewModel));
        }
Esempio n. 4
0
        public async Task GivenListelemeEkranindaYerAlanBilgileriGirilir(string Firstname, string Lastname, string Birthdate,
                                                                         string Gender)
        {
            //Arrange
            var genders = await optionManager.GetGenders();

            formData = new Dictionary <string, string>
            {
                { "Student.Id", "" },
                { "Student.FirstName", Firstname },
                { "Student.LastName", Lastname },
                { "Student.BirthDate", Birthdate },
                { "Student.Gender", Gender },
            };
        }
        public async Task GivenEklemeEkranindaYerAlanVeBilgileriGirilir(string Firstname, string Lastname,
                                                                        string Birthdate, string Age, string Gender, string StudentId)
        {
            //Arrange
            var genders = await optionManager.GetGenders();

            formData = new Dictionary <string, string>
            {
                { "Student.Id", "" },
                { "Student.FirstName", Firstname },
                { "Student.LastName", Lastname },
                { "Student.BirthDate", Birthdate },
                { "Student.StudentId", StudentId },
                { "Student.Gender", Gender },
                { "Student.Age", Age }
            };

            // scenarioContext.Add("formData", formData);
        }