Пример #1
0
        public void should_store_key()
        {
            var dataProtectionKey = new DataProtectionKey
            {
                FriendlyName = "Key1",
                Xml          = "NotReallyXML"
            };

            _context = new KeyStorageContext(_builder.Options);
            _context.DataProtectionKeys.Add(dataProtectionKey);
            _context.SaveChanges();
            _context.DataProtectionKeys.Count().ShouldEqual(1);

            var updatedEntity = _context.DataProtectionKeys.Find(dataProtectionKey.Id);

            updatedEntity.FriendlyName.ShouldEqual(dataProtectionKey.FriendlyName);
            updatedEntity.Id.ShouldEqual(1);
            updatedEntity.Xml.ShouldEqual(dataProtectionKey.Xml);
        }