public void SingleInheritedEntityBoundActionTest(string entitySetName, string actionName) { Container cntr = new Container(new Uri(BaseAddress)); int newRating = 8; var product = cntr.ExecuteAsync <ODataActionTests_Product>( new Uri(string.Format("{0}/odata/{1}(4)/WebStack.QA.Test.OData.ModelBuilder.ODataActionTests_RatedProduct/Default.{2}", BaseAddress, entitySetName, actionName)), "POST", true, new BodyOperationParameter("newRating", newRating)).Result.Single(); Assert.NotNull(product); Assert.Equal(4, product.ID); Assert.Equal(newRating, ((ODataActionTests_RatedProduct)product).Rating); }
public void SingleEntityBoundActionTest(string entitySetName, string actionName) { Container cntr = new Container(new Uri(BaseAddress)); DateTimeOffset dt = new DateTimeOffset(Convert.ToDateTime("2025-01-01T00:00:00")); var product = cntr.ExecuteAsync<ODataActionTests_Product>( new Uri(string.Format("{0}/odata/{1}(1)/Default.{2}", BaseAddress, entitySetName, actionName)), "POST", true, new BodyOperationParameter("newDate", dt)).Result.Single(); Assert.NotNull(product); Assert.Equal(1, product.ID); Assert.True(product.SupportedUntil.Equals(dt)); }
public void SingleEntityBoundActionTest(string entitySetName, string actionName) { Container cntr = new Container(new Uri(BaseAddress)); DateTimeOffset dt = new DateTimeOffset(Convert.ToDateTime("2025-01-01T00:00:00")); var product = cntr.ExecuteAsync <ODataActionTests_Product>( new Uri(string.Format("{0}/odata/{1}(1)/Default.{2}", BaseAddress, entitySetName, actionName)), "POST", true, new BodyOperationParameter("newDate", dt)).Result.Single(); Assert.NotNull(product); Assert.Equal(1, product.ID); Assert.True(product.SupportedUntil.Equals(dt)); }
public void CollectionOfEntitiesBoundActionTest(string entitySetName, string actionName) { Container cntr = new Container(new Uri(BaseAddress)); DateTimeOffset dt = new DateTimeOffset(Convert.ToDateTime("2025-01-01T00:00:00")); var products = cntr.ExecuteAsync<ODataActionTests_Product>( new Uri(string.Format("{0}/odata/{1}/Default.{2}", BaseAddress, entitySetName, actionName)), "POST", true, new BodyOperationParameter("productIds", new int[] { 1, 2, 3, 4 }), new BodyOperationParameter("newDate", dt)).Result.ToList(); Assert.NotNull(products); Assert.Equal(4, products.Count()); foreach (ODataActionTests_Product prod in products) { Assert.True(prod.SupportedUntil.Equals(dt)); } }
public void CollectionOfEntitiesBoundActionTest(string entitySetName, string actionName) { Container cntr = new Container(new Uri(BaseAddress)); DateTimeOffset dt = new DateTimeOffset(Convert.ToDateTime("2025-01-01T00:00:00")); var products = cntr.ExecuteAsync <ODataActionTests_Product>( new Uri(string.Format("{0}/odata/{1}/Default.{2}", BaseAddress, entitySetName, actionName)), "POST", true, new BodyOperationParameter("productIds", new int[] { 1, 2, 3, 4 }), new BodyOperationParameter("newDate", dt)).Result.ToList(); Assert.NotNull(products); Assert.Equal(4, products.Count()); foreach (ODataActionTests_Product prod in products) { Assert.True(prod.SupportedUntil.Equals(dt)); } }
public void CollectionOfInheritedEntitiesBoundActionTest(string entitySetName, string actionName) { Container cntr = new Container(new Uri(BaseAddress)); int newRating = 10; var products = cntr.ExecuteAsync <ODataActionTests_Product>( new Uri(string.Format("{0}/odata/{1}/WebStack.QA.Test.OData.ModelBuilder.ODataActionTests_RatedProduct/Default.{2}", BaseAddress, entitySetName, actionName)), "POST", true, new BodyOperationParameter("productIds", new int[] { 4 }), new BodyOperationParameter("newRating", newRating)).Result.ToList(); Assert.NotNull(products); Assert.Equal(1, products.Count()); foreach (ODataActionTests_Product prod in products) { Assert.Equal(newRating, ((ODataActionTests_RatedProduct)prod).Rating); } }
public void SingleInheritedEntityBoundActionTest(string entitySetName, string actionName) { Container cntr = new Container(new Uri(BaseAddress)); int newRating = 8; var product = cntr.ExecuteAsync<ODataActionTests_Product>( new Uri(string.Format("{0}/odata/{1}(4)/WebStack.QA.Test.OData.ModelBuilder.ODataActionTests_RatedProduct/Default.{2}", BaseAddress, entitySetName, actionName)), "POST", true, new BodyOperationParameter("newRating", newRating)).Result.Single(); Assert.NotNull(product); Assert.Equal(4, product.ID); Assert.Equal(newRating, ((ODataActionTests_RatedProduct)product).Rating); }
public void CollectionOfInheritedEntitiesBoundActionTest(string entitySetName, string actionName) { Container cntr = new Container(new Uri(BaseAddress)); int newRating = 10; var products = cntr.ExecuteAsync<ODataActionTests_Product>( new Uri(string.Format("{0}/odata/{1}/WebStack.QA.Test.OData.ModelBuilder.ODataActionTests_RatedProduct/Default.{2}", BaseAddress, entitySetName, actionName)), "POST", true, new BodyOperationParameter("productIds", new int[] { 4 }), new BodyOperationParameter("newRating", newRating)).Result.ToList(); Assert.NotNull(products); Assert.Equal(1, products.Count()); foreach (ODataActionTests_Product prod in products) { Assert.Equal(newRating, ((ODataActionTests_RatedProduct)prod).Rating); } }