public void SaveCertificateToPersistentRepository(int expectedCerts, int[] expectedChangedItems, List <Certificate> certs) { dao = new MongoCertificateDao(); var changedItems = new List <int>(); certs.ForEach(cert => changedItems.Add(dao.Save(cert))); AreEqual(expectedCerts, dao.Size); True(changedItems.SequenceEqual(expectedChangedItems)); }
public int Save(string serialNumber, string subject, string issuer, DateTime?validFrom, DateTime?validUntil, IDictionary <string, string> extraProperties) => dao.Save( new Certificate { SerialNumber = serialNumber, Subject = subject, Issuer = issuer, ValidFrom = validFrom, ValidUntil = validUntil, ExtraProperties = extraProperties });
public void GetAllPersistent() { dao = new MongoCertificateDao(); dao.Save(CertificateCreatorDummy.CreateDummyCertificate()); AreEqual(1, dao.Size); }
public void GetAllInMemory() { dao = new InMemoryCertificateDao(); dao.Save(CertificateCreatorDummy.CreateDummyCertificate()); AreEqual(1, dao.Size); }