public void GetSmallestNumber(int number1, int number2, int expected) { // Arrange ChallengesSet01 challenger = new ChallengesSet01(); // Act int actual = challenger.GetSmallestNumber(number1, number2); // Assert Assert.Equal(expected, actual); }
public void Subtract(double minuend, double subtrahend, double expectedDifference) { // Arrange ChallengesSet01 challenger = new ChallengesSet01(); // Act double actual = challenger.Subtract(minuend, subtrahend); // Assert Assert.Equal(Math.Round(expectedDifference, 2), Math.Round(actual, 2)); }
public void Add(int addend1, int addend2, int expectedSum) { // Arrange ChallengesSet01 challenger = new ChallengesSet01(); // Act int actual = challenger.Add(addend1, addend2); // Assert Assert.Equal(expectedSum, actual); }
public void AreTwoNumbersTheSame(int number1, int number2, bool expected) { // Arrange ChallengesSet01 challenger = new ChallengesSet01(); // Act bool actual = challenger.AreTwoNumbersTheSame(number1, number2); // Assert Assert.Equal(expected, actual); }
public void GetHey() { // Arrange ChallengesSet01 challenger = new ChallengesSet01(); // Act string actual = challenger.GetHey(); // Assert Assert.Equal("HEY!", actual); }
// [InlineData(null, "Hello!")] // Assumption: string will not be null public void GetGreeting(string personName, string expectedGreeting) { // Arrange ChallengesSet01 challenger = new ChallengesSet01(); // Act string actual = challenger.GetGreeting(personName); // Assert Assert.Equal(expectedGreeting, actual); }
public void Multiply(long factor1, long factor2, long product) { // Arrange ChallengesSet01 challenger = new ChallengesSet01(); // Act long actual = challenger.Multiply(factor1, factor2); // Assert Assert.Equal(product, actual); }
// [InlineData(null, "Hello!")] // Assumption: string will not be null public void GetGreeting(string personName, string expectedGreeting) //ChallengesWithTest01.cs string was named nameOfPerson { // Arrange ChallengesSet01 challenger = new ChallengesSet01(); // Act string actual = challenger.GetGreeting(personName); // Assert Assert.Equal(expectedGreeting, actual); }