Exemplo n.º 1
0
        public async Task AddCity_ShouldNotAdd_WhenCountryIsInvalid()
        {
            // Arrange
            var responseMessage    = "Invalid country selected.";
            var cityForCreationDto = new CityForCreationDto()
            {
                CountryId = 1,
                Name      = "Belgrade"
            };

            _unitOfWorkMock.Setup(x => x.Countries.GetById(It.IsAny <int>()))
            .ReturnsAsync(() => null);

            // Act
            var result = await _sut.AddCity(cityForCreationDto);

            // Assert
            Assert.Equal(responseMessage, result.Value);
        }