public void FetchUserList_6() { UserProfile UserProfileObj = new UserProfile(); UserProfileObj.SetEmail("*****@*****.**"); List <string> token = new SecurityDataLayer(UserProfileObj).GetTokenList(); if (token.Count == 0) { // token count = 0 means that the account is not logged in or all sessions destroyed // generate the token UserProfileObj.SetPassword("aA!12345"); // this will generate the token in db new UserActions().LoginUserAction(UserProfileObj); token = new SecurityDataLayer(UserProfileObj).GetTokenList(); } UserProfileObj.SetToken(token[token.Count - 1]); string Query = "demouser"; ExpectedOutput = "Success"; GotOutput = ""; try { UserTemplate <IUserProfile> NormalTemplate = new NormalUserTemplate(UserProfileObj, Query); List <IUserProfile> profiles = NormalTemplate.FetchList(); GotOutput = "Success"; } catch (Exception ex) { GotOutput = "FAIL"; } Assert.AreEqual(ExpectedOutput, GotOutput); }
public void FetchUserList_3() { UserProfile UserProfileObj = new UserProfile(); UserProfileObj.SetToken("Abc"); string Query = null; ExpectedOutput = "FAIL"; GotOutput = ""; try { UserTemplate <IUserProfile> NormalTemplate = new NormalUserTemplate(UserProfileObj, Query); List <IUserProfile> profiles = NormalTemplate.FetchList(); GotOutput = "Success"; } catch (Exception ex) { GotOutput = "FAIL"; } Assert.AreEqual(ExpectedOutput, GotOutput); }