Exemple #1
0
 /// <summary>
 /// <para>Attempts to parse <see cref="DataRate"/> from a string.</para>
 /// <para>In case of failure a <see cref="FormatException"/> is thrown.</para>
 /// </summary>
 public static DataRate Parse(string input) =>
 DataRateParser.Parse(input);
Exemple #2
0
 public void Should_throw_FormatException_on_Parse_wrong_format()
 {
     new Action(() => DataRateParser.Parse(@"10 \s")).Should().Throw <FormatException>();
 }
Exemple #3
0
 /// <summary>
 /// Attempts to parse <see cref="DataRate"/> from a string.
 /// </summary>
 public static bool TryParse(string input, out DataRate result) =>
 DataRateParser.TryParse(input, out result);
Exemple #4
0
 public void Should_TryParse(string input, bool boolRes, int seconds)
 {
     DataRateParser.TryParse(input, out var res).Should()
     .Be(boolRes && res.BytesPerSecond == seconds);
 }