Beispiel #1
0
 public void TheMachine_InvalidArguments_Throws()
 {
     Assert.That(() => TheMachine.GetTheAnswer(""), Throws.ArgumentNullException);
     Assert.That(() => TheMachine.GetTheAnswer("  "), Throws.ArgumentNullException);
     Assert.That(() => TheMachine.GetTheAnswer(null), Throws.ArgumentNullException);
 }
Beispiel #2
0
        public void TheMachine_GetAnwer_CorrectResult()
        {
            Int32 answer = TheMachine.GetTheAnswer("To all and everything in the universe");

            Assert.That(answer, Is.EqualTo(42));
        }
Beispiel #3
0
 static void Main(string[] args)
 {
     Console.WriteLine("Hello world");
     Console.WriteLine($"The answer is: {TheMachine.GetTheAnswer("Give it to me")}");
     Console.WriteLine("Thats good to know!");
 }