示例#1
0
 /// <summary>
 /// Convert the value of this <see cref="FlowRouting"/> enumeration to an inp <see cref="string"/>
 /// </summary>
 /// <param name="routingValue">The this object that will be used for the extension method</param>
 /// <returns>Returns: An inp <see cref="string"/> that corresponds to the value of <paramref name="routingValue"/></returns>
 public static string ToInpString(this FlowRouting routingValue) => routingValue switch
 {
 public void ToInpString_ValidString_ShouldMatchPassedString(string expectedString, FlowRouting value)
 => Assert.Equal(PruneInpString(expectedString, OptionsHeader), new FlowRoutingOption(value).ToInpString());
示例#3
0
 /// <summary>
 /// Convert a string <paramref name="s"/> to
 /// a <see cref="FlowRouting"/> value as per the inp spec.
 /// </summary>
 /// <param name="routing">The value for the extension method</param>
 /// <param name="s">The <see cref="string"/> that will be used to create the value</param>
 /// <returns>Returns: The converted value from the string that will be a <see cref="FlowRouting"/> value</returns>
 public static FlowRouting FromInpString(this FlowRouting routing, string s) => s switch
 {
     // Conversion for the steady flow option
     "STEADY" => FlowRouting.SteadyFlow,
 public void ParserTests_ValidInpString_ShouldMatchExpectedValue(string value, FlowRouting expectedValue)
 => Assert.Equal(expectedValue, SetupProject(value).Database.GetOption <FlowRoutingOption>().Value);