Пример #1
0
        public void ShoudBePossibleToGetAWebReponse()
        {
            dynamic order = Restfulie.At(GetServiceFake("http:\\localhost:3000\\order\\1.xml")).Get();

            Assert.IsNotNull(order);
            Assert.IsNotNull(order.WebResponse);
        }
Пример #2
0
        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");
        }
Пример #3
0
        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();
        }
Пример #4
0
        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);
        }
Пример #5
0
 public void ShouldBeThrowAnErrorIfTheInvokeGetMethodWithoutUriDefined()
 {
     dynamic entryPointService = Restfulie.At(GetServiceFake(""));
     dynamic order             = entryPointService.Get();
 }
Пример #6
0
        public void ShouldHasAnInstanceOfDefaultEntryPointServiceDefinedWithoutSetAConfiguration()
        {
            dynamic entryPointService = Restfulie.At("uri");

            Assert.IsNotNull(entryPointService);
        }
Пример #7
0
        public void ShouldBePossibleDefineConfigurationOfEntryPointService()
        {
            dynamic entryPointService = Restfulie.At(GetServiceFake("http:\\localhost:3000\\order\\1.xml"));

            Assert.IsNotNull(entryPointService);
        }