protected ConcurrentDictionary<string, PostcodeRegion> GetPractceDictionary() { // Create test PostcodeRegions var postcodeRegion1 = new PostcodeRegion { Postcode = Data.Postcode1, Region = Data.RegionLondon }; var postcodeRegion2 = new PostcodeRegion { Postcode = Data.Postcode2, Region = Data.RegionNe }; // Create dictionary to return, add the values var dictionary = new ConcurrentDictionary<string, PostcodeRegion>(); dictionary.TryAdd(Data.PracticeCode1, postcodeRegion1); dictionary.TryAdd(Data.PracticeCode2, postcodeRegion2); return dictionary; }
protected Practices GetPractices() { // Create test PostcodeRegions var postcodeRegion1 = new PostcodeRegion { Postcode = Data.Postcode1, Region = Data.RegionLondon }; var postcodeRegion2 = new PostcodeRegion { Postcode = Data.Postcode2, Region = Data.RegionNe }; // Create dictionary, add the values var dictionary = new ConcurrentDictionary<string, PostcodeRegion>(); dictionary.TryAdd(Data.PracticeCode1, postcodeRegion1); dictionary.TryAdd(Data.PracticeCode2, postcodeRegion2); // Return new Practices object return new Practices(dictionary); }