示例#1
0
        // 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" });
        }
示例#2
0
        // 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" });
        }
示例#3
0
        // 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()
                                        } });
        }
示例#4
0
        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"]);
        }
示例#5
0
 public void WrongFormatForUpdate()
 {
     AreEqual("invalid arguments provided", viewModel.PerformUpdate("1234" + CertificateCreatorDummy.CreateDummyCertificate()));
 }
示例#6
0
            // 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" });
            }
示例#7
0
 public void Dispose()
 {
     dao.Delete(CertificateCreatorDummy.CreateDummyCertificate().SerialNumber);
 }
示例#8
0
 public void GetAllPersistent()
 {
     dao = new MongoCertificateDao();
     dao.Save(CertificateCreatorDummy.CreateDummyCertificate());
     AreEqual(1, dao.Size);
 }
示例#9
0
 public void GetAllInMemory()
 {
     dao = new InMemoryCertificateDao();
     dao.Save(CertificateCreatorDummy.CreateDummyCertificate());
     AreEqual(1, dao.Size);
 }