public void SetUp()
        {
            var hostUrl = HostHelper.GenerateAHostUrlForAStubServer();

            TestContext.CurrentContext.SetCurrentHostUrl(hostUrl);
            var endpointToHit = hostUrl + "/endpoint";

            TestContext.CurrentContext.SetCurrentEndpointToHit(endpointToHit);
            TestContext.CurrentContext.SetCurrentHttpMock(HttpMockRepository.At(hostUrl));
        }
Пример #2
0
        public void Should_stubs_on_different_ports_each_time()
        {
            string expected = "expected response";
            var    hostUrl  = HostHelper.GenerateAHostUrlForAStubServerWith("app");

            HttpMockRepository.At(hostUrl)
            .Stub(x => x.Get("/app/endpoint"))
            .Return(expected)
            .OK();

            WebClient wc = new WebClient();

            Assert.That(wc.DownloadString(string.Format("{0}/endpoint", hostUrl)), Is.EqualTo(expected));
        }
        public void SetUp()
        {
            var hostUrl = HostHelper.GenerateAHostUrlForAStubServer();

            _endpointToHit      = hostUrl + "/endpoint";
            _httpMockRepository = HttpMockRepository.At(hostUrl);

            _httpMockRepository.Stub(x => x.Get("/endpoint"))
            .WithHeaders(_firstSetOfHeaders)
            .Return("I was the first one")
            .OK();
            _httpMockRepository.Stub(x => x.Get("/endpoint"))
            .WithHeaders(_secondSetOfHeaders)
            .Return("I was the second one")
            .OK();
            _httpMockRepository.Stub(x => x.Get("/endpoint"))
            .WithHeaders(_thirdSetOfHeaders)
            .Return("I was the third one")
            .OK();
        }
Пример #4
0
 public void SetUp()
 {
     _hostUrl = HostHelper.GenerateAHostUrlForAStubServer();
 }
 public void SetUp()
 {
     hostUrl  = HostHelper.GenerateAHostUrlForAStubServer();
     stubHttp = HttpMockRepository.At(hostUrl);
 }
Пример #6
0
 public void SetUp()
 {
     _endpointToHit      = HostHelper.GenerateAHostUrlForAStubServerWith("endpoint");
     _httpMockRepository = HttpMockRepository.At(_endpointToHit);
 }
Пример #7
0
 public void SetUp()
 {
     _hostUrl            = HostHelper.GenerateAHostUrlForAStubServer();
     _httpMockRepository = HttpMockRepository.At(_hostUrl);
 }
Пример #8
0
 public void SetUp()
 {
     TestContext.CurrentContext.SetCurrentHostUrl(HostHelper.GenerateAHostUrlForAStubServer());
 }
Пример #9
0
 public void SetUp()
 {
     _hostUrl = HostHelper.GenerateAHostUrlForAStubServer();
     stubHttp = HttpMockRepository.At(_hostUrl);
     stubHttp.IsAvailable();
 }