From cb8403f5cdf444c9a56fa36b3449819f983de3b6 Mon Sep 17 00:00:00 2001 From: Yannan Date: Fri, 26 Jan 2024 09:55:05 -0500 Subject: [PATCH] add postValidation on showcase relationalStore/Service/Basic --- .../Relational Store/Service/Basic/code.pure | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/showcases/data/Store/Relational Store/Service/Basic/code.pure b/showcases/data/Store/Relational Store/Service/Basic/code.pure index c47a370e0..2331c58ad 100644 --- a/showcases/data/Store/Relational Store/Service/Basic/code.pure +++ b/showcases/data/Store/Relational Store/Service/Basic/code.pure @@ -372,6 +372,20 @@ Service showcase::northwind::services::tds::OrderDetailsByIdTDS mapping: showcase::northwind::mapping::NorthwindMapping; runtime: showcase::northwind::runtime::NorthwindRuntime; } + postValidations: + [ + { + description: 'a simple passing validation with static parameter'; + params:[ + |10248 + ]; + assertions:[ + rowCountGreaterThan10: tds: TabularDataSet[1]|$tds->filter( + row|$row.getString('Employee/First Name')->startsWith('T') +)->meta::legend::service::validation::assertTabularDataSetEmpty('Expected no Employee/First Name to begin with the letter T') + ]; + } + ] } Service showcase::northwind::services::tds::ProductRankingWithinCategory @@ -445,6 +459,20 @@ Service showcase::northwind::services::tds::Customers mapping: showcase::northwind::mapping::NorthwindMapping; runtime: showcase::northwind::runtime::NorthwindRuntime; } + postValidations: + [ + { + description: 'A simple passing validation'; + params:[ + + ]; + assertions:[ + noCompanyNamedAroundtheHorn: tds: TabularDataSet[1]|$tds->filter( + row|$row.getString('Company Name')->contains('Around the Hornsss') +)->meta::legend::service::validation::assertTabularDataSetEmpty('Expected there is no company named Around the Hornsss') + ]; + } + ] } Service showcase::northwind::services::graph::ShipperValidationDefects @@ -1186,4 +1214,4 @@ Runtime showcase::northwind::runtime::NorthwindRuntime }# ] ]; -} +} \ No newline at end of file