Exemple #1
0
		public IRestResponse Put( SpDefineApi.Product product )
		{
			var request = new RestRequest( product._links.self.href, Method.PUT );
			request.RequestFormat = DataFormat.Json;
			request.AddBody( product );

			return Execute( request );
		}
Exemple #2
0
			public static void GetProductListShouldYieldData( SpDefineApi api )
			{
				var apiResult = api.GetProductList();
				// It should always be possible to get the list
				Assert.Equal( HttpStatusCode.OK, apiResult.StatusCode );
				// If the request is OK, there should always be some Data
				Assert.NotNull( apiResult.Data );
				// An empty product list is always represented as an empty collection, not null
				Assert.NotNull( apiResult.Data.Products );
			}
Exemple #3
0
			public RandomProductFromListFixture( SpDefineApi api )
			{
				_api = api;
				var apiResult = api.GetProductList();
				Assert.Equal( HttpStatusCode.OK, apiResult.StatusCode );
				Assert.True( apiResult.Data.Products.Any(), "RandomProductFromListFixture requires the target login to have at least one Product" );
				_randomProduct = apiResult.Data.Products.ElementAtRandom();
			}