protected override void SpecificBuild() { var ctrXml = ConstraintXml as LookupExistsXml; ctrXml.ResultSet.Settings = ctrXml.Settings; var factory = new ColumnIdentifierFactory(); var mappings = new ColumnMappingCollection( ctrXml.Join?.Mappings .Select(mapping => new ColumnMapping( factory.Instantiate(mapping.Candidate) , factory.Instantiate(mapping.Reference) , mapping.Type)) .Union( ctrXml.Join?.Usings.Select(@using => new ColumnMapping( factory.Instantiate(@using.Column) , @using.Type) ))); var builder = new ResultSetServiceBuilder(); var helper = new ResultSetSystemHelper(ServiceLocator, SettingsXml.DefaultScope.Assert, Variables); builder.Setup(helper.InstantiateResolver(ctrXml.ResultSet)); builder.Setup(helper.InstantiateAlterations(ctrXml.ResultSet)); var service = builder.GetService(); var ctr = ctrXml.IsReversed ? new LookupReverseExistsConstraint(service) : new LookupExistsConstraint(service); Constraint = ctr.Using(mappings); }
protected virtual object InstantiateSystemUnderTest(ResultSetSystemXml resultSetXml) { var builder = new ResultSetServiceBuilder(); var helper = new ResultSetSystemHelper(ServiceLocator, SettingsXml.DefaultScope.SystemUnderTest, Variables); builder.Setup(helper.InstantiateResolver(resultSetXml)); builder.Setup(helper.InstantiateAlterations(resultSetXml)); return(builder.GetService()); }
protected override void SpecificBuild() { var ctrXml = ConstraintXml as LookupMatchesXml; ctrXml.ResultSet.Settings = ctrXml.Settings; var joinMappings = new ColumnMappingCollection(BuildMappings(ctrXml.Join)); var inclusionMappings = new ColumnMappingCollection(BuildMappings(ctrXml.Inclusion)); var inclusionTolerances = BuildTolerances(ctrXml.Inclusion); var builder = new ResultSetServiceBuilder(); var helper = new ResultSetSystemHelper(ServiceLocator, SettingsXml.DefaultScope.Assert, Variables); builder.Setup(helper.InstantiateResolver(ctrXml.ResultSet)); builder.Setup(helper.InstantiateAlterations(ctrXml.ResultSet)); var service = builder.GetService(); var ctr = new LookupMatchesConstraint(service); Constraint = ctr.Using(joinMappings, inclusionMappings, inclusionTolerances); }
public override void Setup(AbstractSystemUnderTestXml sutXml, AbstractConstraintXml ctrXml, IConfiguration config, IDictionary <string, ITestVariable> variables, ServiceLocator serviceLocator) { base.Setup(sutXml, ctrXml, config, variables, serviceLocator); Helper = new ResultSetSystemHelper(ServiceLocator, Variables); }