public async Task IsValid_should_require_at_least_password_or_keyfile()
        {
            // Not specified
            var data = new PasswordData();

            Assert.False(data.IsValid);

            // Password only
            data.Password = "******";
            Assert.True(data.IsValid);

            using (var keyfile = TestFiles.Read("IO.Demo7Pass.bin"))
            {
                // Password & keyfile
                await data.AddKeyFile(keyfile);

                Assert.True(data.IsValid);
            }

            // Keyfile only
            data.Password = null;
            Assert.True(data.IsValid);

            // Not specified
            data.ClearKeyfile();
            Assert.False(data.IsValid);
        }
        /// <summary>
        /// Removes the keyfile.
        /// </summary>
        public void ClearKeyfile()
        {
            KeyfileName = null;
            _password.ClearKeyfile();

            NotifyOfPropertyChange(() => CanOpenDatabase);
            NotifyOfPropertyChange(() => CanClearKeyfile);
            NotifyOfPropertyChange(() => KeyfileGroupVisibility);
        }
        public async Task ClearKeyfile_should_clear_registered_keyfile()
        {
            using (var keyfile = TestFiles.Read("IO.Demo7Pass.bin"))
            {
                var data = new PasswordData();
                await data.AddKeyFile(keyfile);

                Assert.True(data.HasKeyFile);

                data.ClearKeyfile();
                Assert.False(data.HasKeyFile);
            }
        }