コード例 #1
0
 public UserController(IUserRepository repository, IInteractionRepository interactionRepository
                       , IVoucherRepository voucherRepository, IProductRepository productRepository)
 {
     _repository            = repository;
     _interactionRepository = interactionRepository;
     _voucherRepository     = voucherRepository;
     _productRepository     = productRepository;
 }
コード例 #2
0
 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;
 }
コード例 #4
0
 public ShowroomerController(IShowroomerRepository repository, IVoucherRepository voucherRepository,
                             IInteractionRepository interactionRepository, IShowroomRepository showroomRepository,
                             IProductRepository productRepository)
 {
     _repository            = repository;
     _voucherRepository     = voucherRepository;
     _interactionRepository = interactionRepository;
     _showroomRepository    = showroomRepository;
     _productRepository     = productRepository;
 }
コード例 #5
0
 public ProductController(IProductRepository repository, IInteractionRepository interactionRepository,
                          IShowroomRepository showroomRepository, IImageRepository imageRepository,
                          IUserRepository userRepository)
 {
     _repository            = repository;
     _interactionRepository = interactionRepository;
     _showroomRepository    = showroomRepository;
     _imageRepository       = imageRepository;
     _userRespository       = userRepository;
 }
コード例 #6
0
 /// <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();
 }
コード例 #7
0
 /// <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;
 }
コード例 #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));
        }
コード例 #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();
                }
            }
        }
コード例 #10
0
 //depedency injection
 public InteractionService(IInteractionRepository interactionRepository)
 {
     _interactionRepository = interactionRepository;
 }
コード例 #11
0
 public BuyerController(IBuyerRepository repository, IInteractionRepository interactionRepository, IUserRepository userrepository)
 {
     _repository            = repository;
     _interactionRepository = interactionRepository;
     _userrepository        = userrepository;
 }