public void UpdateCountries_OneToCreate() { //Arrange var countriesRepository = new Mock <ICountriesRepository>(); countriesRepository.Setup(r => r.GetAll()).Returns(new List <Country>().AsQueryable()); countriesRepository.Setup(r => r.Add(It.IsAny <Country>())).Callback((Country country) => { }); countriesRepository.Setup(r => r.Delete(It.IsAny <Country>())).Callback((Country[] countries) => { }); countriesRepository.Setup(r => r.GetAll()).Returns(new List <Country>().AsQueryable()); CountriesBL countriesBL = new CountriesBL(countriesRepository.Object); //Act UpdateCountriesResult updateCountriesResult = countriesBL.UpdateCountries(new List <Country>(new[] { new Country { EnglishName = "Some Country" } })); //Assert Assert.That(updateCountriesResult.Created.Count, Is.EqualTo(1)); Assert.That(updateCountriesResult.Updated.Count, Is.EqualTo(0)); Assert.That(updateCountriesResult.Deleted.Count, Is.EqualTo(0)); }
public void GetOnlineCountries_ShouldReturn246() { //Arrange CountriesBL countriesBL = new CountriesBL(null); //Act List <Country> onlineCountries = countriesBL.GetOnlineCountries(); //Assert Assert.That(onlineCountries.Count, Is.EqualTo(246)); }
public ProductsController(ProductCategoriesBL productCategoriesBL, ProductsBL productsBL, BrandsBL brandsBL, CountriesBL countriesBL, ContentContentTypesBL contentContentTypesBL, ProductPhotosBL productPhotosBL, CurrenciesBL currenciesBL) { _productCategoriesBL = productCategoriesBL; _productsBL = productsBL; _brandsBL = brandsBL; _countriesBL = countriesBL; _contentContentTypesBL = contentContentTypesBL; _productPhotosBL = productPhotosBL; _currenciesBL = currenciesBL; }
public CountriesController(CountriesBL countriesBL) { _countriesBL = countriesBL; }
public CurrenciesController(CurrenciesBL currenciesBL, CountriesBL countriesBL) { _currenciesBL = currenciesBL; _countriesBL = countriesBL; }