public void Init() { var person = new Person {FirstName = "Tammy", LastName = "Meinershagen"}; Request .WithUri(GetUriString(PostModule.Resource)) .Post<Person, Guid>(person); }
public void given_multiple_threads_when_getting_current_response_should_return_thread_specific_response() { Action action1 = () => { var person = new Person {FirstName = "Tammy", LastName = "Ellis"}; Request .WithUri(GetUriString(PostModule.Resource)) .Post<Person, Guid>(person); Request .CurrentResponse<Guid>() .Body.Should().NotBeEmpty(); }; Action action2 = () => { Request .WithUri(GetUriString(GetModule.PeopleResource)) .Get<IList<Person>>(); Request .CurrentResponse<IList<Person>>() .Body.Should().NotBeNull(); }; Parallel.Invoke(action1, action2); }
public void Init() { var person = new Person { FirstName = "Tammy", LastName = "Meinershagen" }; Request .WithUri(GetUriString(PostModule.Resource)) .WithHeaders(new {x_requested_with = "XMLHttpRequest"}) .Post<Person, Guid>(person); }