public void ShoudBePossibleToGetAWebReponse() { dynamic order = Restfulie.At(GetServiceFake("http:\\localhost:3000\\order\\1.xml")).Get(); Assert.IsNotNull(order); Assert.IsNotNull(order.WebResponse); }
public void ShouldBePossibleToGetAResourceRepresentationByTheEntryFluentInteface() { dynamic order = Restfulie.At(GetServiceFake("order.xml")).Get(); Assert.IsNotNull(order); Assert.IsNotNull(order.date, "the attribute date is no expected"); Assert.IsNotNull(order.total, "the attribute total is no expected"); }
private void GetResource(object state) { _inProgress = true; Thread.Sleep(2000); // simulate remote request Restfulie.At("http://localhost:62968/order.xml") .Asynch(RestfulieResponseHandler, "Test State") .Get(); }
public void ShouldBePossibleToCreateResourcesFromEntryPoint() { string resourceXml = "<city> " + " <name>Minas Gerais</name> " + " <population> " + " <size>230000</size> " + " <growth>15</growth> " + " </population> " + " <updated-at>10/01/2010</updated-at> " + " <link rel=\"next_largest\" href=\"city.xml\" /> " + "</city> "; dynamic newCity = Restfulie.At(GetServiceFake("http://localhost:3000/cities")).Create(resourceXml); Assert.AreEqual(System.Net.HttpStatusCode.OK, newCity.WebResponse.StatusCode); }
public void ShouldBeThrowAnErrorIfTheInvokeGetMethodWithoutUriDefined() { dynamic entryPointService = Restfulie.At(GetServiceFake("")); dynamic order = entryPointService.Get(); }
public void ShouldHasAnInstanceOfDefaultEntryPointServiceDefinedWithoutSetAConfiguration() { dynamic entryPointService = Restfulie.At("uri"); Assert.IsNotNull(entryPointService); }
public void ShouldBePossibleDefineConfigurationOfEntryPointService() { dynamic entryPointService = Restfulie.At(GetServiceFake("http:\\localhost:3000\\order\\1.xml")); Assert.IsNotNull(entryPointService); }