public void AddLocationAlreadyExisting_ShouldReturnExpected() { int?newLocationAlreadyExisting = _utilityManager.GetIdForLocationOrCreateIfNotExists("Umeå"); var expectedCount = 5; var resultCount = _utilityManager.GetAllLocations().Count(); Assert.AreEqual(expectedCount, resultCount); Assert.AreEqual(1, newLocationAlreadyExisting); }
// PRIVATE METHODS BELOW private IEnumerable <string> GetLocations(string searchString) { IEnumerable <string> locations = _utilitiesManager.GetAllLocations() .Where(n => n.Name.ToUpper().Contains(searchString.ToUpper())) .Select(a => a.Name); return(locations); }