Example #1
0
 public void MasterKeyExpireIsInfinite()
 {
     // Assign/Act
     var db = new Database(TestConstants.BlankKey);
     // Assert
     Assert.IsNull(db.MasterKeyExpire);
 }
Example #2
0
 public void IsGeneratedByKeePass()
 {
     // Assign/Act
     const string generator = "KeePass";
     var db = new Database(TestConstants.BlankKey);
     // Assert
     Assert.AreEqual(generator, db.Generator);
 }
Example #3
0
        public void MasterKeyChangedDateTimeMatchesCreationDateTime()
        {
            Smock.Run(ctx =>
            {
                // Fakes
                var utcNow = DateTime.UtcNow;
                ctx.Setup(() => DateTime.UtcNow).Returns(utcNow);

                // Assign/Act
                var db = new Database(TestConstants.BlankKey);
                // Assert
                Assert.AreEqual(DateTime.UtcNow, db.MasterKeyChanged);
            });
        }
Example #4
0
 public void RootGroupNameIsDefaultedIfNotSpecified()
 {
     // Assign/Act
     const string expectedValue = "Root";
     var db = new Database(TestConstants.BlankKey);
     // Assert
     Assert.AreEqual(expectedValue, db.Root.Name.ToString());
 }
Example #5
0
 public void RootGroupMatchesDatabaseName()
 {
     // Assign/Act
     var db = new Database(TestConstants.BlankKey)
     {
         Name = "TestDB"
     };
     // Assert
     Assert.IsNotNull(db.Root);
     Assert.AreEqual(db.Name, db.Root.Name.ToString());
 }