Exemple #1
0
        public EnquiryApiControllerTest()
        {
            var serviceProvider = services.BuildServiceProvider();

            enquiryAppService = serviceProvider.GetService <IEnquiryAppService>();
            var config = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <EnquiryModel, Enquiry>();
                cfg.CreateMap <EnquiryReplyModel, EnquiryReply>();
                cfg.ValidateInlineMaps = false;
            });

            mapper = config.CreateMapper();
            rootConfigurationsMock = SetupConfigurations.GetApplicationConfiguration(Directory.GetCurrentDirectory());
            _enquiryController     = new EnquiryController(enquiryAppService, mapper, rootConfigurationsMock.Object);
        }
 public EnquiryController(IEnquiryAppService enquiryAppService, IMapper mapper, IOptionsSnapshot <RootConfigurations> rootConfiguration) : base(rootConfiguration)
 {
     _enquiryAppService = enquiryAppService;
     _mapper            = mapper;
 }