private static JToken GetTokenAs(Role role) { var users = JsonDataHelper.ToObject <List <User> >("Configuration\\credentials.json"); var testUser = users.Where(user => user.Role == role.ToString()).SingleOrDefault(); var tokenObject = IdentityAPI.GetToken(testUser.Email, testUser.Password); return(tokenObject); }
private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (XtraMessageBox.Show("是否确认删除该条记录?", "删除确认", MessageBoxButtons.OKCancel) == DialogResult.OK) { studentsList.RemoveAll(m => m.StuNo == ((Student)DataGrid.GetRow(DataGrid.GetSelectedRows()[0])).StuNo); JsonDataHelper.SaveJsonData(studentsList, studentJsonSource); GridLoadData(); } }
public static IEnumerable <User> CredentialsJson(string key) { var testUsers = JsonDataHelper.ToObject <List <User> >("TestData\\users.json"); return(testUsers.Where(user => user.Key == key)); }
public static void LoadConfiguration() { Settings = JsonDataHelper.ToObject <Setting>("Configuration\\settings.json"); }
public void TestInit() { LoginPage = new LoginPage(Driver); TestUsers = JsonDataHelper.ToObject <List <User> >("\\TestData\\users.json"); }
public static void Main(string[] args) { JsonDataHelper.CreateDict(); CreateWebHostBuilder(args).Build().Run(); }
public static void SetConfig() { Settings = JsonDataHelper.ToObject <Setting>("Config\\settings.json"); }