// ReSharper disable once MemberCanBePrivate.Global MemberData works ONLY with public providers public static IEnumerable <object[]> SaveProvider() { yield return(new object[] { true, parser.Convert(CertificateCreatorDummy.CreateDummyCertificate()) }); yield return(new object[] { true, parser.Convert(CertificateCreatorDummy.CreateDummyCertificateWithoutExtraProperties()) }); yield return(new object[] { false, "jsksklkls" }); }
// ReSharper disable once MemberCanBePrivate.Global MemberData works ONLY with public providers public static IEnumerable <object[]> SaveProviderIntegration() { yield return(new object[] { $"Certificate {CertificateCreatorDummy.CreateDummyCertificate()} {Environment.NewLine}saved to DB :)", parser.Convert(CertificateCreatorDummy.CreateDummyCertificate()) }); yield return(new object[] { $"Certificate {CertificateCreatorDummy.CreateDummyCertificateWithoutExtraProperties()} {Environment.NewLine}saved to DB :)", parser.Convert(CertificateCreatorDummy.CreateDummyCertificateWithoutExtraProperties()) }); yield return(new object[] { "Certificate already exists", "jsksklkls" }); }
// ReSharper disable once MemberCanBePrivate.Global MemberData works ONLY with public providers public static IEnumerable <object[]> SaveProvider() { yield return(new object[] { 0, new int[] {}, new List <Certificate>() }); yield return(new object[] { 1, new[] { 1 }, new List <Certificate> { CertificateCreatorDummy.CreateDummyCertificate() } }); yield return(new object[] { 1, new[] { 1, 0 }, new List <Certificate> { CertificateCreatorDummy.CreateDummyCertificate(), CertificateCreatorDummy.CreateDummyCertificate() } }); }
public void CreateCertificate() { var cert = CertificateCreatorDummy.CreateDummyCertificate(); AreEqual("1234567890", cert.SerialNumber); AreEqual("test", cert.Subject); AreEqual("me", cert.Issuer); AreEqual(DateTime.Today, cert.ValidFrom); AreEqual(DateTime.Today.AddDays(1), cert.ValidUntil); AreEqual("test", cert.ExtraProperties["Category"]); AreEqual("qwerty", cert.ExtraProperties["Identifier"]); AreEqual("1234", cert.ExtraProperties["Token"]); }
public void WrongFormatForUpdate() { AreEqual("invalid arguments provided", viewModel.PerformUpdate("1234" + CertificateCreatorDummy.CreateDummyCertificate())); }
// ReSharper disable once MemberCanBePrivate.Global MemberData works ONLY with public providers public static IEnumerable <object[]> UpdateProviderIntegration() { yield return(new object[] { "Certificate successfully updated from DB :)", parser.Convert(CertificateCreatorDummy.CreateDummyCertificate()) }); yield return(new object[] { "Certificate successfully updated from DB :)", parser.Convert(CertificateCreatorDummy.CreateDummyCertificateWithoutExtraProperties()) }); yield return(new object[] { "Certificate does not exist", "jsksklkls" }); }
public void Dispose() { dao.Delete(CertificateCreatorDummy.CreateDummyCertificate().SerialNumber); }
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); }