/// <summary> /// Extension method that will convert a <see cref="InertialTermsHandling"/> value into /// a <see cref="string"/> that corresponds to its respective inp string. /// </summary> /// <param name="terms">The value of the terms that will be converted to a <see cref="string"/></param> /// <returns>Returns: an inp string that corresponds to the value of the <paramref name="terms"/></returns> public static string ToInpString(this InertialTermsHandling terms) => terms switch {
public void ToInpString_ValidString_ShouldMatchExpected(string inpString, InertialTermsHandling expectedValue) => Assert.Equal(PruneInpString(inpString, OptionsHeader), new InertialTermsOption(expectedValue).ToInpString());
/// <summary> /// Convert this <see cref="InertialTermsHandling"/> object /// into another using a <see cref="string"/> that represents a string /// that is from an inp file /// </summary> /// <param name="terms">The this for the extensions method</param> /// <param name="value">The value of the string that will be converted</param> /// <exception cref="ArgumentException"> /// Thrown if the string passed does not match a prescribed pattern /// </exception> /// <returns>Returns: A <see cref="InertialTermsHandling"/> value corresponding to the /// correct inp value</returns> public static InertialTermsHandling FromInpString(this InertialTermsHandling terms, string value) => value switch { "NONE" => InertialTermsHandling.Keep,
public void ParserTests_ValidInpString(string value, InertialTermsHandling expectedValue) => Assert.Equal(expectedValue, SetupProject(value).Database.GetOption <InertialTermsOption>().Value);