Example #1
0
        public void RegisterConsultantSuccessTest()
        {
            // get a valid consultant account
            Consultant         consultant = TestRepository.GetValidConsultant();
            IConsultantService conService = new ConsultantService();

            // must have a valid consultant
            Assert.NotNull(consultant);

            Logger.Debug(consultant, true);

            var task = conService.RegisterConsultant(consultant);

            task.Wait();
            var conResponse = task.Result;

            // consultant registration should be successful
            Assert.True(conResponse.Select(conApiResponse => conApiResponse.Code == ApiResponseCode.RegisterSuccess).FirstOrDefault());

            // generate and register new random password
            string           plainPassword   = TestRepository.GetValidPlainPassword();
            IPasswordService passwordService = new PasswordService();

            var passTask = passwordService.RegisterPassword(consultant.Username, plainPassword);

            passTask.Wait();
            var passResponse = passTask.Result;

            // registration should be successful
            Assert.True(passResponse.Select(passApiResponse => passApiResponse.Code == ApiResponseCode.RegisterSuccess).FirstOrDefault());
        }
Example #2
0
        public (Consultant, List <ApiResponse>) RegisterConsultant(Consultant consultant = null)
        {
            consultant = consultant ?? TestRepository.GetValidConsultant();
            IConsultantService consultantService = new ConsultantService();

            var task = consultantService.RegisterConsultant(consultant);

            task.Wait();
            var response = task.Result;

            return(consultant, response);
        }
        // lahat valid dapat
        public (Consultant, List <ApiResponse>) RegisterPendingConsultantWithPassword(Consultant consultant = null)
        {
            consultant = consultant ?? TestRepository.GetValidConsultant();
            IConsultantService consultantService = new ConsultantService();

            var task = consultantService.RegisterConsultant(consultant);

            task.Wait();
            var conResponse = task.Result;

            passwordUsage.RegisterPassword(consultant.Username);

            return(consultant, conResponse);
        }
        public (Consultant, List <ApiResponse>) RegisterConsultantWithPassword(Consultant consultant = null, bool accept = false)
        {
            consultant = consultant ?? TestRepository.GetValidConsultant();
            IConsultantService consultantService = new ConsultantService();

            var task = consultantService.RegisterConsultant(consultant);

            task.Wait();
            var conResponse = task.Result;

            passwordUsage.RegisterPassword(consultant.Username);

            // ACCEPT NATIN
            // consultantService.AcceptConsultantByUsername(consultant.Username);

            return(consultant, conResponse);
        }