public virtual AlibabaCloudCredentials GetCredentials() { if (basicSessionCredentials == null || basicSessionCredentials.WillSoonExpire()) { basicSessionCredentials = GetNewSessionCredentials(); } return(basicSessionCredentials); }
public void WillSoonExpire() { BasicSessionCredentials instance; instance = new BasicSessionCredentials("accessKeyId", "accessKeySecret", "sessionToken", 1); instance.WillSoonExpire(); instance = new BasicSessionCredentials("accessKeyId", "accessKeySecret", "sessionToken", 0); instance.WillSoonExpire(); Assert.False(instance.WillSoonExpire()); }