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")); }
public void ConsumablesToHours_InputContainsUnknownMetric_ThrowsArgumentException() { // Assert Assert.Throws <ArgumentException>(() => StarshipManager.ConsumablesToHours("1 second")); }
public void ConsumablesToHours_InputIsEmptyString_ThrowsArgumentNullException() { // Assert Assert.Throws <ArgumentNullException>(() => StarshipManager.ConsumablesToHours(string.Empty)); }
public void ConsumablesToHours_InvalidInput_ThrowsFormatException() { // Assert Assert.Throws <FormatException>(() => StarshipManager.ConsumablesToHours("fadfasf")); }
public void ConsumablesToHours_InputIsNull_ThrowsArgumentNullException() { // Assert Assert.Throws <ArgumentNullException>(() => StarshipManager.ConsumablesToHours(null)); }