public void Should_ThrowArgumentException_When_GivingANullChange() { // Arrange string change = null; // Act & Assert Assert.Throws <ArgumentException>(() => FrequencyChange.FromStringInput(change)); }
public void Should_ThrowArgumentException_When_GivingANonIntegerString() { // Arrange const string change = "adasad"; // Act & Assert Assert.Throws <ArgumentException>(() => FrequencyChange.FromStringInput(change)); }
public void Should_GiveTheIntegerFormOfTheChange_When_GivingCorrectNegativeIntegerString() { // Arrange var changeInt = -123; var change = changeInt.ToString(); // Act var frequencyChange = FrequencyChange.FromStringInput(change); // Assert Assert.NotNull(frequencyChange); Assert.Equal(changeInt, frequencyChange.Change); }
public void Should_GiveTheIntegerFormOfTheChange_When_GivingCorrectPositiveIntegerStringWithPlusSign() { // Arrange var changeInt = 123; var change = $"+{changeInt}"; // Act var frequencyChange = FrequencyChange.FromStringInput(change); // Assert Assert.NotNull(frequencyChange); Assert.Equal(changeInt, frequencyChange.Change); }
public void Should_HaveFrequencyNumberThatIsEqualToStartPlusChange_When_ApplyingOneChange() { // Arrange var start = 7683; var change = FrequencyChange.FromStringInput("+5"); var frequency = Frequency.StartFromInteger(start); // Act frequency.Add(change); // Assert Assert.Equal(start + change.Change, frequency.FrequencyNumber); }