public void PostgresOverridingUserValueCalledTwiceAddsCorrectAdditionalFeature() { var expression = new InsertDataExpression(); var builder = new InsertDataExpressionBuilder(expression); builder.WithOverridingUserValue().WithOverridingUserValue(); expression.AdditionalFeatures.ShouldContain( new KeyValuePair <string, object>( PostgresExtensions.OverridingIdentityValues, PostgresOverridingIdentityValuesType.User)); }
public void PostgresOverridingIdentityValuesCalledWithDifferentTypeAddsCorrectAdditionalFeature() { // If both WithOverridingSystemValue() and WithOverridingUserValue() are called on the same expression, // then the latest value should be set in the additional features var expressionForUserValue = new InsertDataExpression(); var builderForUserValue = new InsertDataExpressionBuilder(expressionForUserValue); builderForUserValue.WithOverridingSystemValue().WithOverridingUserValue(); var expressionForSystemValue = new InsertDataExpression(); var builderForSystemValue = new InsertDataExpressionBuilder(expressionForSystemValue); builderForSystemValue.WithOverridingUserValue().WithOverridingSystemValue(); expressionForUserValue.AdditionalFeatures.ShouldContain( new KeyValuePair <string, object>( PostgresExtensions.OverridingIdentityValues, PostgresOverridingIdentityValuesType.User)); expressionForSystemValue.AdditionalFeatures.ShouldContain( new KeyValuePair <string, object>( PostgresExtensions.OverridingIdentityValues, PostgresOverridingIdentityValuesType.System)); }