Exemplo n.º 1
0
 public UserController(IUserRepository repository, IInteractionRepository interactionRepository
                       , IVoucherRepository voucherRepository, IProductRepository productRepository)
 {
     _repository            = repository;
     _interactionRepository = interactionRepository;
     _voucherRepository     = voucherRepository;
     _productRepository     = productRepository;
 }
 private HttpClient CreateHttpClient(
     HttpRecorderMode mode,
     [CallerMemberName] string testName = "",
     IInteractionRepository repository  = null)
 => new HttpClient(new HttpRecorderDelegatingHandler(testName, mode: mode, repository: repository))
 {
     BaseAddress = _fixture.ServerUri,
 };
 public InteractionService(IInteractionRepository interactionRepository,
                           IUnitOfWork unitOfWork,
                           IHttpClientFactory clientFactory)
 {
     this.InteractionRepository = interactionRepository;
     this.unitOfWork            = unitOfWork;
     ClientFactory = clientFactory;
 }
 public ShowroomerController(IShowroomerRepository repository, IVoucherRepository voucherRepository,
                             IInteractionRepository interactionRepository, IShowroomRepository showroomRepository,
                             IProductRepository productRepository)
 {
     _repository            = repository;
     _voucherRepository     = voucherRepository;
     _interactionRepository = interactionRepository;
     _showroomRepository    = showroomRepository;
     _productRepository     = productRepository;
 }
Exemplo n.º 5
0
 public ProductController(IProductRepository repository, IInteractionRepository interactionRepository,
                          IShowroomRepository showroomRepository, IImageRepository imageRepository,
                          IUserRepository userRepository)
 {
     _repository            = repository;
     _interactionRepository = interactionRepository;
     _showroomRepository    = showroomRepository;
     _imageRepository       = imageRepository;
     _userRespository       = userRepository;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpRecorderDelegatingHandler" /> class.
 /// </summary>
 /// <param name="interactionName">
 /// The name of the interaction.
 /// If you use the default <see cref="IInteractionRepository"/>, this will be the path to the HAR file (relative or absolute) and
 /// if no file extension is provided, .har will be used.
 /// </param>
 /// <param name="mode">The <see cref="HttpRecorderMode" />. Defaults to <see cref="HttpRecorderMode.Auto" />.</param>
 /// <param name="innerHandler">The inner <see cref="HttpMessageHandler" /> to configure. If not provided, <see cref="HttpClientHandler" /> will be used.</param>
 /// <param name="matcher">
 /// The <see cref="IRequestMatcher"/> to use to match interactions with incoming <see cref="HttpRequestMessage"/>.
 /// Defaults to matching Once by <see cref="HttpMethod"/> and <see cref="HttpRequestMessage.RequestUri"/>.
 /// <see cref="RulesMatcher.ByHttpMethod"/> and <see cref="RulesMatcher.ByRequestUri"/>.
 /// </param>
 /// <param name="repository">
 /// The <see cref="IInteractionRepository"/> to use to read/write the interaction.
 /// Defaults to <see cref="HttpArchiveInteractionRepository"/>.
 /// </param>
 public HttpRecorderDelegatingHandler(
     string interactionName,
     HttpRecorderMode mode             = HttpRecorderMode.Auto,
     HttpMessageHandler innerHandler   = null,
     IRequestMatcher matcher           = null,
     IInteractionRepository repository = null)
     : base(innerHandler ?? new HttpClientHandler())
 {
     InteractionName = interactionName;
     Mode            = mode;
     _matcher        = matcher ?? RulesMatcher.MatchOnce.ByHttpMethod().ByRequestUri();
     _repository     = repository ?? new HttpArchiveInteractionRepository();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpRecorderDelegatingHandler" /> class.
 /// </summary>
 /// <param name="interactionName">
 /// The name of the interaction.
 /// If you use the default <see cref="IInteractionRepository"/>, this will be the path to the HAR file (relative or absolute) and
 /// if no file extension is provided, .har will be used.
 /// </param>
 /// <param name="mode">The <see cref="HttpRecorderMode" />. Defaults to <see cref="HttpRecorderMode.Auto" />.</param>
 /// <param name="matcher">
 /// The <see cref="IRequestMatcher"/> to use to match interactions with incoming <see cref="HttpRequestMessage"/>.
 /// Defaults to matching Once by <see cref="HttpMethod"/> and <see cref="HttpRequestMessage.RequestUri"/>.
 /// <see cref="RulesMatcher.ByHttpMethod"/> and <see cref="RulesMatcher.ByRequestUri"/>.
 /// </param>
 /// <param name="repository">
 /// The <see cref="IInteractionRepository"/> to use to read/write the interaction.
 /// Defaults to <see cref="HttpArchiveInteractionRepository"/>.
 /// </param>
 /// <param name="anonymizer">
 /// The <see cref="IInteractionAnonymizer"/> to use to anonymize the interaction.
 /// Defaults to <see cref="RulesInteractionAnonymizer.Default"/>.
 /// </param>
 public HttpRecorderDelegatingHandler(
     string interactionName,
     HttpRecorderMode mode             = HttpRecorderMode.Auto,
     IRequestMatcher matcher           = null,
     IInteractionRepository repository = null,
     IInteractionAnonymizer anonymizer = null)
 {
     InteractionName = interactionName;
     Mode            = mode;
     _matcher        = matcher ?? RulesMatcher.MatchOnce.ByHttpMethod().ByRequestUri();
     _repository     = repository ?? new HttpArchiveInteractionRepository();
     _anonymizer     = anonymizer ?? RulesInteractionAnonymizer.Default;
 }
Exemplo n.º 8
0
        /// <summary>
        /// Adds <see cref="HttpRecorderDelegatingHandler"/> as a HttpMessageHandler in the client pipeline.
        /// </summary>
        /// <param name="httpClientBuilder">The <see cref="IHttpClientBuilder"/>.</param>
        /// <param name="interactionName">
        /// The name of the interaction.
        /// If you use the default <see cref="IInteractionRepository"/>, this will be the path to the HAR file (relative or absolute) and
        /// if no file extension is provided, .har will be used.
        /// </param>
        /// <param name="mode">The <see cref="HttpRecorderMode" />. Defaults to <see cref="HttpRecorderMode.Auto" />.</param>
        /// <param name="matcher">
        /// The <see cref="IRequestMatcher"/> to use to match interactions with incoming <see cref="HttpRequestMessage"/>.
        /// Defaults to matching Once by <see cref="HttpMethod"/> and <see cref="HttpRequestMessage.RequestUri"/>.
        /// <see cref="RulesMatcher.ByHttpMethod"/> and <see cref="RulesMatcher.ByRequestUri"/>.
        /// </param>
        /// <param name="repository">
        /// The <see cref="IInteractionRepository"/> to use to read/write the interaction.
        /// Defaults to <see cref="HttpArchiveInteractionRepository"/>.
        /// </param>
        /// <param name="anonymizer">
        /// The <see cref="IInteractionAnonymizer"/> to use to anonymize the interaction.
        /// Defaults to <see cref="RulesInteractionAnonymizer.Default"/>.
        /// </param>
        /// <returns>The updated <see cref="IHttpClientBuilder"/>.</returns>
        public static IHttpClientBuilder AddHttpRecorder(
            this IHttpClientBuilder httpClientBuilder,
            string interactionName,
            HttpRecorderMode mode             = HttpRecorderMode.Auto,
            IRequestMatcher matcher           = null,
            IInteractionRepository repository = null,
            IInteractionAnonymizer anonymizer = null)
        {
            var recorder = new HttpRecorderDelegatingHandler(
                interactionName,
                mode: mode,
                matcher: matcher,
                repository: repository,
                anonymizer: anonymizer);

            return(httpClientBuilder.AddHttpMessageHandler((sp) => recorder));
        }
Exemplo n.º 9
0
        //free calls:
        //-init
        //-view
        //Licenced calls:
        //-viewWithModel
        //-control
        //-callingStructure
        //-initServicedRepo
        //-viewControllerMethodCall
        //-controlBindableProperty
        //-modelProperty
        //proprietary calls:
        // -partial
        public static void Main(string[] args)
        {
            IBonsaiCommandRepository commsRepo = new BonsaiCommandRepository();

            BInteraction      = new InteractionRepository();
            CommandRepository = new BonsaiCommandRepository();
            var projectReader = GetReaderRepository();

            LoaderReposetory.TestForDataFiles(ConfigurationManager.AppSettings["AppName"]);

            while (GetConfirmation(out args))
            {
                var commandMapKeys = BInteraction.ReturnAvailableAccessMap(args);
                foreach (var command in commandMapKeys)
                {
                    Console.WriteLine(command.Value);
                    Console.ReadLine();
                }
            }
        }
Exemplo n.º 10
0
 //depedency injection
 public InteractionService(IInteractionRepository interactionRepository)
 {
     _interactionRepository = interactionRepository;
 }
Exemplo n.º 11
0
 public BuyerController(IBuyerRepository repository, IInteractionRepository interactionRepository, IUserRepository userrepository)
 {
     _repository            = repository;
     _interactionRepository = interactionRepository;
     _userrepository        = userrepository;
 }