예제 #1
0
 public void Initialize()
 {
     this.identifierFactory = new Mock <IIdentifierFactory>();
     this.identifierFactory.Setup(f => f.IsValid(It.IsAny <Identifier>())).Returns(true);
     this.validator =
         new SearchAvailableDoctorsRequestValidator(new HasSearchOptionsValidator(new HasGetOptionsValidator()));
     this.dto = new SearchAvailableDoctorsRequest
     {
         FromUtc = null,
         ToUtc   = null
     };
 }
예제 #2
0
        public SearchAvailableDoctorsResponse Get(SearchAvailableDoctorsRequest request)
        {
            var fromUtc   = request.FromUtc.GetValueOrDefault(DateTime.MinValue);
            var toUtc     = request.ToUtc.GetValueOrDefault(DateTime.MaxValue);
            var available = this.clinicsApplication.SearchAvailableDoctors(Request.ToCaller(), fromUtc, toUtc,
                                                                           request.ToSearchOptions(defaultSort: Reflector <Clinic> .GetPropertyName(c => c.Id)),
                                                                           request.ToGetOptions());

            return(new SearchAvailableDoctorsResponse
            {
                Doctors = available.Results,
                Metadata = available.Metadata
            });
        }