public void defaults_arguments() { const string expectedOptionalArgument = ParametersObject.OPTIONAL_PARAMETER_DEFAULT; const int expectedRequiredArgument = ParametersObject.REQUIRED_PARAMETER_MINIMUM; var result = ParametersObject.Create(expectedRequiredArgument); Assert.Equal(expectedOptionalArgument, result.OptionalParameter); Assert.Equal(expectedRequiredArgument, result.RequiredParameter); }
public void assigns_arguments() { const string expectedOptionalArgument = EXPECTED_OPTIONAL_ARGUMENT; const int expectedRequiredArgument = ParametersObject.REQUIRED_PARAMETER_MINIMUM; var result = ParametersObject.Create( expectedRequiredArgument, i => { i.OptionalParameter = expectedOptionalArgument; }); Assert.Equal(expectedOptionalArgument, result.OptionalParameter); Assert.Equal(expectedRequiredArgument, result.RequiredParameter); }
public void validates_arguments() { const string expectedOptionalArgument = EXPECTED_OPTIONAL_ARGUMENT; const int expectedRequiredArgument = ParametersObject.REQUIRED_PARAMETER_MINIMUM - 1; var ex = Assert.Throws <ArgumentOutOfRangeException>( () => ParametersObject.Create( expectedRequiredArgument, i => { i.OptionalParameter = expectedOptionalArgument; }) ); Assert.Equal("RequiredParameter", ex.ParamName); }