public void Stubs_should_be_unique_within_context() { var wc = new WebClient(); string stubbedReponseOne = "Response for first test in context"; string stubbedReponseTwo = "Response for second test in context"; IStubHttp stubHttp = _httpMockRepository.WithNewContext(); stubHttp.Stub(x => x.Post("/firsttest")).Return(stubbedReponseOne).OK(); stubHttp.Stub(x => x.Post("/secondtest")).Return(stubbedReponseTwo).OK(); Assert.That(wc.UploadString("Http://localhost:8080/firsttest/", ""), Is.EqualTo(stubbedReponseOne)); Assert.That(wc.UploadString("Http://localhost:8080/secondtest/", ""), Is.EqualTo(stubbedReponseTwo)); }
public void SetUp() { _httpMockRepository = HttpMockRepository.At("http://localhost:8080/"); }
public void SetUp() { _httpMockRepository = HttpMockRepository.At("http://localhost:8080/"); }