public async Task TestThat_GetCoffeeShopLocation_When_ValidationDoesNotFail_Returns_NotNullLocation() { // Arrange var csvLineParser = new CsvLineParser(); // Act var location = await csvLineParser.GetCoffeeShopLocation(MockObjects.ValidCsvLine1); // Assert Assert.NotNull(location); }
public async Task TestThat_GetCoffeeShopLocation_When_ValidatorDoesNotFail_Returns_LocationWithExpectedValues() { var csvLineParser = new CsvLineParser(); // Act var location = await csvLineParser.GetCoffeeShopLocation(MockObjects.ValidCsvLine99); // Assert Assert.Equal(MockObjects.ShopLocation99.X, location.X); Assert.Equal(MockObjects.ShopLocation99.Y, location.Y); Assert.Equal(MockObjects.ShopLocation99.Tag, location.Tag); }
public async Task TestThat_GetCoffeeShopLocation_When_CsvLineHasErrorOnPositionTwo_Throws_DataValidationExceptionWithExpectedMessage() { // Arrange var csvLineParser = new CsvLineParser(); // Act async Task Act() => await csvLineParser.GetCoffeeShopLocation(MockObjects.Token2ErrorCsvLine); // Assert var exception = await Assert.ThrowsAsync <DataValidationException>(Act); Assert.Equal(MockValues.IncorrectValuePosition2CsvLineExceptionMessage, exception.Message); }
public async Task TestThat_GetCoffeeShopLocation_When_CsvLineHasMoreThanThreeTokens_Throws_DataValidationExceptionWithExpectedMessage() { // Arrange var csvLineParser = new CsvLineParser(); // Act async Task Act() => await csvLineParser.GetCoffeeShopLocation(MockObjects.MoreThanThreeTokensCsvLine); // Assert var exception = await Assert.ThrowsAsync <DataValidationException>(Act); Assert.Equal(MockValues.IncorrectNumberOfTokensCsvLineExceptionMessage, exception.Message); }
public async Task TestThat_GetCoffeeShopLocation_When_CsvLineIsEmpty_Throws_DataValidationExceptionWithExpectedMessage() { // Arrange var csvLineParser = new CsvLineParser(); // Act async Task Act() => await csvLineParser.GetCoffeeShopLocation(MockObjects.StringNullCsvLine); // Assert var exception = await Assert.ThrowsAsync <DataValidationException>(Act); Assert.Equal(MockValues.NullOrEmptyCsvLineExceptionMessage, exception.Message); }