private static void InitData() { // get dictionary of all avaiable bands and their specification from the web service // this is done first so we can use them with the entries data ResistorCalculatorService.ResistorCalculatorServiceClient service = new ResistorCalculatorService.ResistorCalculatorServiceClient(); Dictionary <int, ResistorCalculatorService.BandDetail> bandColors = service.GetBandList(); List <Band> bands = new List <Band>(); foreach (KeyValuePair <int, ResistorCalculatorService.BandDetail> band in bandColors) { ResistorCalculatorService.BandDetail bandItem = (ResistorCalculatorService.BandDetail)band.Value; Band bandColor = new Band(band.Key, bandItem); bands.Add(bandColor); } // get dictionary of all avaiable bands and their specification from the web service Dictionary <int, ResistorCalculatorService.EntryDetail> entryList = service.GetEntryList(); List <Entry> entries = new List <Entry>(); foreach (KeyValuePair <int, ResistorCalculatorService.EntryDetail> entry in entryList) { ResistorCalculatorService.EntryDetail entryItem = (ResistorCalculatorService.EntryDetail)entry.Value; Entry entryData = new Entry(entryItem.ID, entryItem); entries.Add(entryData); } // set the static lists Bands = bands; Entries = entries; }
public void GetBandList() { // Arrange ResistorCalculatorService.ResistorCalculatorServiceClient service = new ResistorCalculatorService.ResistorCalculatorServiceClient(); // Act Dictionary <int, ResistorCalculatorService.BandDetail> bandList = service.GetBandList(); // Assert Assert.AreEqual(bandList.Count, 14); }