public void Database_Validatesecret_tests() { LiteJsonDatabase.Insert(ApiSecret); Assert.AreEqual(1, LiteJsonDatabase.GetAll().Count); Assert.IsTrue(LiteJsonDatabase.ValidateSecret(ApiSecret.Secret)); Assert.IsFalse(LiteJsonDatabase.ValidateSecret("hau27541HFAK82541asfag")); }
public void Database_Delete_tests() { Assert.AreEqual(0, LiteJsonDatabase.GetAll().Count); LiteJsonDatabase.Insert(ApiSecret); Assert.AreEqual(1, LiteJsonDatabase.GetAll().Count); LiteJsonDatabase.Delete(ApiSecret); Assert.AreEqual(0, LiteJsonDatabase.GetAll().Count); }
public void Database_Insert_tests() { Assert.AreEqual(0, LiteJsonDatabase.GetAll().Count); LiteJsonDatabase.Insert(ApiSecret); var apisecret = LiteJsonDatabase.GetAll(); Assert.NotNull(apisecret); Assert.AreEqual(1, apisecret.Count); }
public void Database_Update_tests() { LiteJsonDatabase.Insert(ApiSecret); Assert.AreEqual(1, LiteJsonDatabase.GetAll().Count); var updatedApiSecret = LiteJsonDatabase.Find(ApiSecret); updatedApiSecret.Owner = "potetmos"; LiteJsonDatabase.Update(updatedApiSecret); Assert.AreEqual("potetmos", LiteJsonDatabase.GetBySecret(ApiSecret.Secret).Owner); }
public void GetAllSecrets(Action <IList <IApiSecret>, Exception> callback) { callback(LiteJsonDatabase.GetAll(), null); }