public void TestInvalidCustomPropertyConstraintNotSatisfied() { var config = new CustomEnvsSchema() { USERID_HEADER_KEY = "userheaderkey", USER_PROPERTIES_HEADER_KEY = "userproperties", GROUPS_HEADER_KEY = "usergroups", CLIENTTYPE_HEADER_KEY = "clienttype", BACKOFFICE_HEADER_KEY = "isbackoffice", MICROSERVICE_GATEWAY_SERVICE_NAME = "microservice-gateway", MyCustomEnvVariable = "customEnvVariable", MyNumberVariable = 1 }; Assert.Throws(typeof(ValidationException), () => config.Validate()); }
public void TestValidConfigDefaultMicroserviceGateway() { var config = new CustomEnvsSchema { USERID_HEADER_KEY = "userheaderkey", USER_PROPERTIES_HEADER_KEY = "userproperties", GROUPS_HEADER_KEY = "usergroups", CLIENTTYPE_HEADER_KEY = "clienttype", BACKOFFICE_HEADER_KEY = "isbackoffice", MyCustomEnvVariable = "customEnvVariable", MyMandatoryVariable = "var", MyNumberVariable = 54 }; Assert.DoesNotThrow(() => config.Validate()); Assert.AreEqual("microservice-gateway", config.MICROSERVICE_GATEWAY_SERVICE_NAME); }
public void TestInvalidConfigAllPropsNull() { var config = new CustomEnvsSchema(); Assert.Throws(typeof(ValidationException), () => config.Validate()); }