public void BreweryService_RemoveExistingBrewery_DeleteBrewery() { string breweryName = "Zeppelin Brews"; IBreweryRepository<Brewery> repository = new BreweryRepository(); var breweryService = new BreweryService(repository); var newBrewery = new Brewery { Name = breweryName, Description = "Beers for the guitar heros", Location = new Location { Address = "Beer Avenue", City = "London", Country = "United Kingdom" } }; breweryService.InsertBrewery(newBrewery); var brewery = breweryService.GetBrewery(breweryName); Assert.IsNotNull(brewery); breweryService.RemoveBrewery(breweryName); brewery = breweryService.GetBrewery(breweryName); Assert.IsNull(brewery); }
public void BreweryService_ValidBreweryRequested_ReturnBrewery() { string breweryName = "Bluth Brews"; IBreweryRepository<Brewery> repository = new BreweryRepository(); var breweryService = new BreweryService(repository); var brewery = breweryService.GetBrewery(breweryName); Assert.IsNotNull(brewery); }
public void BreweryService_InvalidBreweryRequested_ReturnNull() { IBreweryRepository<Brewery> repository = new BreweryRepository(); var breweryService = new BreweryService(repository); string breweryName = "Carrie Nation Brewing Company"; var brewery = breweryService.GetBrewery(breweryName); Assert.IsNull(brewery); }