Exemplo n.º 1
0
 public void ConsumablesToHours_ValidInput_ConvertsToHours()
 {
     // Assert
     Assert.Equal((ulong)52560, StarshipManager.ConsumablesToHours("6 years"));
     Assert.Equal((ulong)8760, StarshipManager.ConsumablesToHours("1 year"));
     Assert.Equal((ulong)4320, StarshipManager.ConsumablesToHours("6 months"));
     Assert.Equal((ulong)720, StarshipManager.ConsumablesToHours("1 month"));
     Assert.Equal((ulong)144, StarshipManager.ConsumablesToHours("6 days"));
     Assert.Equal((ulong)24, StarshipManager.ConsumablesToHours("1 day"));
     Assert.Equal((ulong)6, StarshipManager.ConsumablesToHours("6 hours"));
     Assert.Equal((ulong)1, StarshipManager.ConsumablesToHours("1 hour"));
 }
Exemplo n.º 2
0
 public void ConsumablesToHours_InputContainsUnknownMetric_ThrowsArgumentException()
 {
     // Assert
     Assert.Throws <ArgumentException>(() => StarshipManager.ConsumablesToHours("1 second"));
 }
Exemplo n.º 3
0
 public void ConsumablesToHours_InputIsEmptyString_ThrowsArgumentNullException()
 {
     // Assert
     Assert.Throws <ArgumentNullException>(() => StarshipManager.ConsumablesToHours(string.Empty));
 }
Exemplo n.º 4
0
 public void ConsumablesToHours_InvalidInput_ThrowsFormatException()
 {
     // Assert
     Assert.Throws <FormatException>(() => StarshipManager.ConsumablesToHours("fadfasf"));
 }
Exemplo n.º 5
0
 public void ConsumablesToHours_InputIsNull_ThrowsArgumentNullException()
 {
     // Assert
     Assert.Throws <ArgumentNullException>(() => StarshipManager.ConsumablesToHours(null));
 }