public void SetUp()
        {
            this.restConfigurations = new List <IRestConfiguration>();
            this.mockWrapperFactory = A.Fake <IWrapperFactory>();
            this.mockNetworkFactory = A.Fake <INetworkFactory>();

            this.configuration1 = A.Fake <IRestConfiguration>();
            A.CallTo(() => this.configuration1.BaseUrl).Returns("url1");
            A.CallTo(() => this.configuration1.UserName).Returns("user1");
            A.CallTo(() => this.configuration1.Password).Returns("password1");
            A.CallTo(() => this.configuration1.IsServerOn).Returns(true);
            A.CallTo(() => this.configuration1.Name).Returns("conf1");
            restConfigurations.Add(this.configuration1);


            this.configuration2 = A.Fake <IRestConfiguration>();
            A.CallTo(() => this.configuration2.BaseUrl).Returns("url2");
            A.CallTo(() => this.configuration2.UserName).Returns("user2");
            A.CallTo(() => this.configuration2.Password).Returns("password2");
            A.CallTo(() => this.configuration2.IsServerOn).Returns(true);
            A.CallTo(() => this.configuration2.Name).Returns("conf2");
            restConfigurations.Add(this.configuration2);

            this.mockHttpClientHandler = A.Fake <IHttpClient>();
            this.mockRestConsumer      = A.Fake <IRestConsumer>();

            A.CallTo(() => this.mockWrapperFactory.CreateHttpClientHandler(this.configuration1.UserName, this.configuration1.Password)).Returns(mockHttpClientHandler);
            A.CallTo(() => this.mockNetworkFactory.CreateRestConsumer(A <IUri> .Ignored, mockHttpClientHandler, mockWrapperFactory)).Returns(mockRestConsumer);

            this.testee = new RestFactory(this.restConfigurations, this.mockWrapperFactory, mockNetworkFactory);
        }
 public CarFinderService(IVehicleReader vehicleReader,
                         IVehicleWriter vehicleWriter,
                         IRestFactory restFactory)
 {
     _vehicleWriter = vehicleWriter;
     _restFactory = restFactory;
     _vehicleReader = vehicleReader;
 }
        public void SetUp()
        {
            this.mockRestFactory = A.Fake <IRestFactory>();

            this.mockNetworkFactory = A.Fake <INetworkFactory>();

            this.testee = new Service(this.mockRestFactory, this.mockNetworkFactory);
        }
        public void SetUp()
        {
            this.mockRestFactory = A.Fake<IRestFactory>();

            this.mockNetworkFactory = A.Fake<INetworkFactory>();

            this.testee = new Service(this.mockRestFactory, this.mockNetworkFactory);
        }
 public CarQuoteService(ICarQuoteRequestWriter carQuoteRequestWriter,
                         ICarQuoteResponseWriter carQuoteResponseWriter,
                         ICarQuoteResponseReader carQuoteResponseReader,
                         IRestFactory restFactory)
 {
     _carQuoteResponseReader = carQuoteResponseReader;
     _carQuoteResponseWriter = carQuoteResponseWriter;
     _restFactory = restFactory;
     _carQuoteRequestWriter = carQuoteRequestWriter;
 }
 public GetLabelsOfPlanRequest(IRestFactory restClientFactory, IRequestParameterAspectFactory parameterAspectFactory)
     : base(restClientFactory, parameterAspectFactory)
 {
 }
 public DeleteLabelOfPlanCommand(IRestFactory restClientFactory, IRequestParameterAspectFactory parameterAspectFactory)
     : base(restClientFactory, parameterAspectFactory)
 {
 }
 public GetCurrentUserRequest(IRestFactory restClientFactory, IRequestParameterAspectFactory parameterAspectFactory)
     : base(restClientFactory, parameterAspectFactory)
 {
 }
Esempio n. 9
0
 public Service(IRestFactory restFactory, INetworkFactory networkFactory)
 {
     this.restFactory    = restFactory;
     this.networkFactory = networkFactory;
     this.updaters       = new List <IUpdater>();
 }
Esempio n. 10
0
 public DeleteProjectCommand(IRestFactory restClientFactory, IRequestParameterAspectFactory parameterAspectFactory)
     : base(restClientFactory, parameterAspectFactory)
 {
 }
 public GetAllPlansRequest(IRestFactory restClientFactory, IRequestParameterAspectFactory parameterAspectFactory)
     : base(restClientFactory, parameterAspectFactory)
 {
 }
 public EnableDisablePlanCommand(IRestFactory restClientFactory, IRequestParameterAspectFactory parameterAspectFactory)
     : base(restClientFactory, parameterAspectFactory)
 {
 }
Esempio n. 13
0
 public GetInformationOfRequest(IRestFactory restClientFactory, IRequestParameterAspectFactory parameterAspectFactory)
     : base(restClientFactory, parameterAspectFactory)
 {
 }
Esempio n. 14
0
 protected BuildCommandBase(IRestFactory restClientFactory, IRequestParameterAspectFactory parameterAspectFactory)
     : base(restClientFactory, parameterAspectFactory)
 {
 }
Esempio n. 15
0
 public SearchForPlansRequest(IRestFactory restClientFactory, IRequestParameterAspectFactory parameterAspectFactory)
     : base(restClientFactory, parameterAspectFactory)
 {
 }
Esempio n. 16
0
 protected RestCommunicationBase(IRestFactory restClientFactory, IRequestParameterAspectFactory parameterAspectFactory)
 {
     _restFactory      = restClientFactory;
     _parameterAspects = parameterAspectFactory.GetParameterAspects(GetType());
 }
 public AddLabelToBuildCommand(IRestFactory restClientFactory, IRequestParameterAspectFactory parameterAspectFactory)
     : base(restClientFactory, parameterAspectFactory)
 {
 }
Esempio n. 18
0
 public GetCommentsOfBuildRequest(IRestFactory restClientFactory, IRequestParameterAspectFactory parameterAspectFactory)
     : base(restClientFactory, parameterAspectFactory)
 {
 }
Esempio n. 19
0
 public Service(IRestFactory restFactory, INetworkFactory networkFactory)
 {
     this.restFactory = restFactory;
     this.networkFactory = networkFactory;
     this.updaters = new List<IUpdater>();
 }
Esempio n. 20
0
 public FavouritePlanCommand(IRestFactory restClientFactory, IRequestParameterAspectFactory parameterAspectFactory)
     : base(restClientFactory, parameterAspectFactory)
 {
 }
Esempio n. 21
0
 protected PlanRequestBase(IRestFactory restClientFactory, IRequestParameterAspectFactory parameterAspectFactory)
     : base(restClientFactory, parameterAspectFactory)
 {
 }
        public void SetUp()
        {
            this.restConfigurations = new List<IRestConfiguration>();
            this.mockWrapperFactory = A.Fake<IWrapperFactory>();
            this.mockNetworkFactory = A.Fake<INetworkFactory>();

            this.configuration1 = A.Fake<IRestConfiguration>();
            A.CallTo(() => this.configuration1.BaseUrl).Returns("url1");
            A.CallTo(() => this.configuration1.UserName).Returns("user1");
            A.CallTo(() => this.configuration1.Password).Returns("password1");
            A.CallTo(() => this.configuration1.IsServerOn).Returns(true);
            A.CallTo(() => this.configuration1.Name).Returns("conf1");
            restConfigurations.Add(this.configuration1);

            this.configuration2 = A.Fake<IRestConfiguration>();
            A.CallTo(() => this.configuration2.BaseUrl).Returns("url2");
            A.CallTo(() => this.configuration2.UserName).Returns("user2");
            A.CallTo(() => this.configuration2.Password).Returns("password2");
            A.CallTo(() => this.configuration2.IsServerOn).Returns(true);
            A.CallTo(() => this.configuration2.Name).Returns("conf2");
            restConfigurations.Add(this.configuration2);

            this.mockHttpClientHandler = A.Fake<IHttpClient>();
            this.mockRestConsumer = A.Fake<IRestConsumer>();

            A.CallTo(() => this.mockWrapperFactory.CreateHttpClientHandler(this.configuration1.UserName, this.configuration1.Password)).Returns(mockHttpClientHandler);
            A.CallTo(() => this.mockNetworkFactory.CreateRestConsumer(A<IUri>.Ignored, mockHttpClientHandler, mockWrapperFactory)).Returns(mockRestConsumer);

            this.testee = new RestFactory(this.restConfigurations, this.mockWrapperFactory, mockNetworkFactory);
        }