Esempio n. 1
0
        public async Task TestThat_GetFormattedDistance_When_DistanceIsValid_Returns_NotNullOrEmptyString()
        {
            // Arrange
            var distanceFormatter = new CoffeeShopDistanceFormatter();

            // Act
            var formattedDistance = await distanceFormatter.GetFormattedDistance(MockObjects.ShopDistance1);

            // Assert
            Assert.False(string.IsNullOrEmpty(formattedDistance));
        }
Esempio n. 2
0
        public async Task TestThat_GetFormattedDistance_When_DistanceIsValid_Returns_ExpectedFormattedDistance()
        {
            // Arrange
            var distanceFormatter = new CoffeeShopDistanceFormatter();

            // Act
            var formattedDistance = await distanceFormatter.GetFormattedDistance(MockObjects.ShopDistance1);

            // Assert
            Assert.Equal(MockObjects.FormattedCoffeeShopDistance1, formattedDistance);
        }
Esempio n. 3
0
        public async Task TestThat_GetFormattedDistance_When_DistanceIsNull_Throws_ArgumentNullException()
        {
            // Arrange
            var distanceFormatter = new CoffeeShopDistanceFormatter();

            // Act
            async Task Act() => await distanceFormatter.GetFormattedDistance(MockObjects.NullShopDistance);

            // Assert
            await Assert.ThrowsAnyAsync <ArgumentNullException>(Act);
        }