Пример #1
0
 public void Jump_distance_with_comma_as_decimal_separator_is_parsed_correctly()
 {
     Check.That(DistanceParser.ParseJumpDistance("15,5")).IsEqualTo(15.5);
 }
Пример #2
0
 public void Setup()
 {
     distanceParser = new DistanceParser();
 }
Пример #3
0
 public void Empty_jump_distance_is_not_parsed()
 {
     Check.That(DistanceParser.ParseJumpDistance("")).IsNull();
 }
Пример #4
0
 public void Jump_distance_without_decimals_is_parsed_correctly()
 {
     Check.That(DistanceParser.ParseJumpDistance("15")).IsEqualTo(15);
 }
Пример #5
0
 public void Empty_interstellar_is_not_parsed()
 {
     Check.That(DistanceParser.ParseInterstellarDistance("")).IsNull();
 }
Пример #6
0
 public void Null_interstellar_is_not_parsed()
 {
     Check.That(DistanceParser.ParseInterstellarDistance(null)).IsNull();
 }
Пример #7
0
 public void Interstellar_distance_with_comma_decimal_separator_can_be_parsed()
 {
     Check.That(DistanceParser.ParseInterstellarDistance("12345,6789")).IsEqualTo(12345.6789);
 }
Пример #8
0
 public void Invalid_interstellar_is_not_parsed()
 {
     Check.That(DistanceParser.ParseInterstellarDistance("not a distance")).IsNull();
 }
Пример #9
0
 public void Interstellar_distance_without_any_decimal_separator_can_be_parsed()
 {
     Check.That(DistanceParser.ParseInterstellarDistance("12345")).IsEqualTo(12345);
 }
Пример #10
0
 public void Negative_interstellar_distance_is_not_parsed()
 {
     Check.That(DistanceParser.ParseInterstellarDistance("-12345")).IsEqualTo(null);
 }
Пример #11
0
 public void Jump_distance_that_does_not_match_any_expected_format_is_not_parsed()
 {
     Check.That(DistanceParser.ParseJumpDistance("not a distance")).IsNull();
 }
Пример #12
0
 public void Jump_distance_with_more_than_2_decimals_is_not_parsed()
 {
     Check.That(DistanceParser.ParseJumpDistance("15.000")).IsNull();
 }
Пример #13
0
 public void Negative_jump_distance_is_not_parsed()
 {
     Check.That(DistanceParser.ParseJumpDistance("-15")).IsNull();
 }
Пример #14
0
 public void Jump_distance_equal_to_the_maximum_allowed_value_is_parsed_correctly()
 {
     Check.That(DistanceParser.ParseJumpDistance("15", 15)).IsEqualTo(15);
 }
Пример #15
0
 public void Jump_distance_greater_than_the_maximum_allowed_value_is_not_parsed()
 {
     Check.That(DistanceParser.ParseJumpDistance("15", 14)).IsNull();
 }