This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CarA | |
| { | |
| private int fuelLevel; | |
| public CarA(int initialFuelLevel) | |
| { | |
| fuelLevel = initialFuelLevel; | |
| } | |
| public void Drive(int distance) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ####,m,,jjj,12.42211,8.4212412,##### -> lat: 12.42211 lng: 8.4212412 | |
| 12.42211,8.4212412,##### -> lat: 12.42211 lng: 8.4212412 | |
| #####12.42211,8.4212412,##### -> lat: 12.42211 lng: 8.4212412 | |
| #####12.42211,,##### -> exception | |
| "" -> exception | |
| lat lng | |
| class GPS: | |
| lat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private const string Token = "c417bfd432d32985a579e4363b63a49f"; | |
| string url = $"http://api.openweathermap.org/data/2.5/weather?q={city},de&APPID={Token}&units=metric"; | |
| [Fact] | |
| public void GetWeatherDisplay_ShouldReturnCityAndTemp() | |
| { | |
| // Arrange | |
| string city = "München"; | |
| var apiMock = new Mock<IWeatherApi>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class EMailHandlerTests | |
| { | |
| private readonly EmailHandler _handler; | |
| public EMailHandlerTests() { | |
| _handler = new EmailHandler(); | |
| } | |
| [Theory] | |
| [InlineData("max.mustermann@google.de", true)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [TestCaseSource(nameof(GetTestDataFromFile))] | |
| public void Test_Addition_From_File(int a, int b, int expected) | |
| { | |
| int actual = Mathe.Summe(a, b); | |
| Assert.AreEqual(expected, actual); | |
| } | |
| private static IEnumerable<TestCaseData> GetTestDataFromFile() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using DemoTesting; | |
| namespace DemoTestingNunit | |
| { | |
| public class Tests | |
| { | |
| [SetUp] | |
| public void Setup() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [DataTestMethod()] | |
| [DataRow(5, 5, 10)] | |
| [DataRow(-5, 5, 0)] | |
| [DataRow(-5, -5, -10)] | |
| public void SummeTest_simple(int summand1, int summand2, int expected) | |
| { | |
| // Act | |
| int actual = Mathe.Summe(summand1, summand2); | |
| // Assert |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [TestMethod()] | |
| public void DivTest_byZero() | |
| { | |
| // AAA | |
| // Arrange | |
| int summand1 = 10; | |
| int summand2 = 0; | |
| // Act & Assert | |
| Assert.ThrowsException<ArgumentException>( () => { Mathe.Div(summand1, summand2); } ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [TestMethod()] | |
| public void SummeTest_simple() | |
| { | |
| // AAA | |
| // Arrange | |
| int summand1 = 5; | |
| int summand2 = 5; | |
| int expected = 10; | |
| // Act | |
| int actual = Mathe.Summe(summand1, summand2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Bankkonto: | |
| pass | |
| # Attribute: owner | |
| # iban | |
| # balance | |
| # Methode: withdraw | |
| # deposit | |
NewerOlder