public void StringWithCommasToArrayOfStringValues_StringIsNull_ThrowsError() { // Act Action action = () => _target.StringWithSignSeparatorsToArrayOfValues(null); // Assert action.Should().ThrowExactly <ArgumentNullException>(); }
/// <summary> /// Returns arguments for IpV4Fragmentation struct /// </summary> /// <param name="userInput">String to parse on struct parameters</param> /// <returns>Parameters for IpV4Fragmentation</returns> public object[] InputToParametersForIpV4Fragmentation(string userInput) { var parameters = _stringHelper.StringWithSignSeparatorsToArrayOfValues(userInput); if (parameters.Length == 2) { var firstParam = parameters[0].ToEnum(typeof(IpV4FragmentationOptions)); var secondParam = parameters[1].ToType <ushort>(); if (firstParam != null && secondParam != null) { return(new object[] { firstParam, secondParam }); } } return(null); }