public void Add_Get_Added() { var newBrewery = new Brewery { Name = "NewBrewery" + DateTime.Now.Ticks, Description = "Somehting", Type = "HomeBrewery", OriginId = 5, Address = "Something", Latitude = 60.3894, Longitude = 5.33, Website = "Something", HeaderImage = "Something", Avatar = "Something", }; _breweryRepository.Add(newBrewery); var breweries = _breweryRepository.GetAll(); Assert.True(breweries.Any(b => b.Name == newBrewery.Name)); }
public string Create(string name, string city, string state, string country, string postalCode, string website, string logo) { //TODO Check for existing brewery with the name var id = _breweryRepository.NextIdentity(); var brewery = new Brewery(id, name) { City = city, State = state, Country = country, PostalCode = postalCode, Website = website, Logo = logo }; _breweryRepository.Add(brewery); return(id); }
public void Add(Brewery entity) { _repo.Add(entity); }