Esempio n. 1
0
        public async Task <bool> Testfor_Validate_Invlid_Appointment()
        {
            //Arrange
            bool res             = false;
            var  _newAppointment = new Appointment()
            {
                AppointmentId = 1,
                FullName      = "Kumar singh",
                CurrentWeight = 70,
                Height        = 172,
                Age           = 30,
                GoalWeight    = 60,
                Address       = "New Delhi",
                PhoneNumber   = 9631425152,
                Email         = "*****@*****.**",
                Remark        = "Want wet Loose"
            };

            _newAppointment = null;
            //Act
            service.Setup(repo => repo.BookAppointment(_newAppointment)).ReturnsAsync(_newAppointment = null);
            var result = await _FitnessServices.BookAppointment(_newAppointment);

            if (result == null)
            {
                res = true;
            }
            //Asert
            //final result displaying in text file
            await File.AppendAllTextAsync("../../../../output_exception_revised.txt", "Testfor_Validate_Invlid_Appointment=" + res + "\n");

            return(res);
        }
        public async Task <bool> Testfor_Validate_AppointmentId()
        {
            //Arrange
            bool res = false;

            //Act
            service.Setup(repo => repo.BookAppointment(_appointment)).ReturnsAsync(_appointment);
            var result = await _FitnessServices.BookAppointment(_appointment);

            if (result.AppointmentId == _appointment.AppointmentId)
            {
                res = true;
            }
            //Asert
            //final result displaying in text file
            await File.AppendAllTextAsync("../../../../output_boundary_revised.txt", "Testfor_Validate_AppointmentId=" + res + "\n");

            return(res);
        }