Beispiel #1
0
        public void City_ValidateCity_MustBeValid()
        {
            //Arrange
            var city = _cityTestFixture.GenerateValidCity();

            //Act
            var result = city.ValidateCity();

            //Asert
            Assert.True(result.IsValid);
        }
Beispiel #2
0
        public async Task Add_AddNewValidCity_MustAddCityWithSuccess()
        {
            //Arrange
            var city        = _cityTestFixture.GenerateValidCity();
            var cityService = _autoMocker.CreateInstance <ServiceCity>();

            //Act
            await cityService.AddAsyncUow(city);

            //Assert
            _autoMocker.GetMock <IRepositoryCity>().Verify(r => r.Add(city), Times.Once);
            _autoMocker.GetMock <IUnitOfWork>().Verify(u => u.CommitAsync(), Times.Once);
        }