Esempio n. 1
0
        public void Add_returns_expectedResult(int z1, int z2, int expectedResult)
        {
            Rechner r = new Rechner();

            var result = r.Add(z1, z2);

            Assert.AreEqual(expectedResult, result);
        }
Esempio n. 2
0
        public void Add_Int32Min_and_N1_throws_OverflowException()
        {
            // Arrange: Vorbereitung
            Rechner r = new Rechner();

            Assert.Throws <OverflowException>(() =>
            {
                r.Add(Int32.MinValue, -1);
            });
        }
Esempio n. 3
0
        public void Add_2_and_3_returns_5()
        {
            // Arrange: Vorbereitung
            Rechner r = new Rechner();

            // Act: den zu testenden Code ausführen
            var result = r.Add(2, 3);

            // Assert: Ergebnis interpretieren
            Assert.AreEqual(5, result);
        }