public PeopleRepoTests() { _peopleStore = Substitute.For <IPeopleStore>(); _fileService = Substitute.For <IFileService>(); _jsonService = Substitute.For <IJsonService>(); _peopleRepo = new PeopleRepo(_peopleStore, _fileService, _jsonService, Options.Create(new DataFileSettings())); }
public PeopleRepo(IPeopleStore peopleStore, IFileService fileService, IJsonService jsonService, IOptions <DataFileSettings> options) { _peopleStore = peopleStore; if (_peopleStore.Data == null) { var jsonText = fileService.GetFileContents(options.Value.PeopleJsonFilename); _peopleStore.Data = jsonService.Parse <List <Person> >(jsonText); } }
private void cbbUse_SelectedValueChanged(object sender, EventArgs e) { var x = cbbUse.SelectedItem; if (x is Memory) { store = new Memory(); } else { store = new PeopleStore(); } }