public void Success_when_is_validated_when_auto_generated_and_primary_appended_with_auto_generated_is_specified_in_template() { var templateHandlerNew = BuildTemplateHandler(null); var TemplateValidator = new TemplateValidator(templateHandlerNew, null); var IsColumnNotNullValueColumnContextHandler = new IsColumnNotNullValueColumnContextHandler(templateHandlerNew); var IsColumnPrimaryKeyColumnContextHandler = new IsColumnPrimaryKeyColumnContextHandler(templateHandlerNew); var IsColumnAutoGeneratedValueColumnContextHandler = new IsColumnAutoGeneratedValueColumnContextHandler(templateHandlerNew); var ColumnNameColumnContextHandler = new ColumnNameColumnContextHandler(templateHandlerNew); var TemplateHandlerNew = BuildTemplateHandler(null); String submittedString = IsColumnNotNullValueColumnContextHandler.StartContext + IsColumnPrimaryKeyColumnContextHandler.StartContext + IsColumnAutoGeneratedValueColumnContextHandler.StartContext + ColumnNameColumnContextHandler.Signature + IsColumnAutoGeneratedValueColumnContextHandler.EndContext + IsColumnPrimaryKeyColumnContextHandler.EndContext + IsColumnNotNullValueColumnContextHandler.EndContext + " " + IsColumnPrimaryKeyColumnContextHandler.StartContext + IsColumnAutoGeneratedValueColumnContextHandler.StartContext + ColumnNameColumnContextHandler.Signature + IsColumnAutoGeneratedValueColumnContextHandler.EndContext + IsColumnPrimaryKeyColumnContextHandler.EndContext; bool result = TemplateValidator.TemplateStringValidation(submittedString); bool expectedResult = true; Assert.AreEqual(expectedResult, result); }
public void TemplateValidatorTest() { var ColumnNameColumnContextHandler = new ColumnNameColumnContextHandler(BuildTemplateHandler(null)); var TemplateValidator = new TemplateValidator(BuildTemplateHandler(null), null); String submittedString = ColumnNameColumnContextHandler.Signature; bool value = TemplateValidator.TemplateStringValidation(submittedString); bool expectedValue = true; Assert.AreEqual(expectedValue, value); }
public void Success_when_if_not_auto_conditionned_if_nested_name_template_string_is_validated() { var templateHandlerNew = BuildTemplateHandler(null); var ColumnNameColumnContextHandler = new ColumnNameColumnContextHandler(templateHandlerNew); var TemplateValidator = new TemplateValidator(BuildTemplateHandler(null), null); var IsColumnNotAutoGeneratedValueColumnContextHandler = new IsColumnNotAutoGeneratedValueColumnContextHandler(templateHandlerNew); string submittedString = IsColumnNotAutoGeneratedValueColumnContextHandler.StartContext + ColumnNameColumnContextHandler.Signature + IsColumnNotAutoGeneratedValueColumnContextHandler.EndContext; bool result = TemplateValidator.TemplateStringValidation(submittedString); bool expectedResult = true; Assert.AreEqual(expectedResult, result); }