public void Get_ReturnsParsedBoolValue_WhenKeyIsFound() { var parameters = new ExecutableParameters(new Dictionary <string, string>() { { "mykey", "true" } }); var value = parameters.Get <bool>("mykey"); Assert.True(value); }
public void Get_ReturnsParsedIntValue_WhenKeyIsFound() { var parameters = new ExecutableParameters(new Dictionary <string, string>() { { "mykey", "156" } }); var value = parameters.Get <int>("mykey"); Assert.Equal(156, value); }
public void Get_ReturnsValue_WhenKeyIsFound() { var parameters = new ExecutableParameters(new Dictionary <string, string>() { { "mykey", "my_value" } }); var value = parameters.Get("mykey"); Assert.Equal("my_value", value); }
public void Get_ThrowsException_WhenValueNotCorrectFormat() { var parameters = new ExecutableParameters(new Dictionary <string, string>() { { "mykey", "not_an_integer" } }); var exception = Record.Exception(() => parameters.Get <int>("mykey")); Assert.NotNull(exception); Assert.IsType <FormatException>(exception); }
public void Get_ThrowsException_WhenKeyIsNull() { var exception = Record.Exception(() => _emptyParameters.Get(null)); Assert.NotNull(exception); Assert.IsType <ArgumentNullException>(exception); }