mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Corrected some tests
Minor code refactor Main page now correctly shows save page even when opening a DB from Explorer
This commit is contained in:
@@ -3,21 +3,24 @@ using System.Collections.ObjectModel;
|
||||
using System.Threading.Tasks;
|
||||
using ModernKeePass.Interfaces;
|
||||
using Windows.Storage;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ModernKeePassApp.Test.Mock
|
||||
{
|
||||
class RecentServiceMock : IRecentService
|
||||
{
|
||||
private Dictionary<string, IStorageItem> _recentItems = new Dictionary<string, IStorageItem>();
|
||||
|
||||
public int EntryCount => 0;
|
||||
|
||||
public void Add(IStorageItem file, string metadata)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
_recentItems.Add(metadata, file);
|
||||
}
|
||||
|
||||
public void ClearAll()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
_recentItems.Clear();
|
||||
}
|
||||
|
||||
public ObservableCollection<IRecentItem> GetAllFiles(bool removeIfNonExistant = true)
|
||||
@@ -27,7 +30,7 @@ namespace ModernKeePassApp.Test.Mock
|
||||
|
||||
public Task<IStorageItem> GetFileAsync(string token)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return Task.Run(() => _recentItems[token]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -159,12 +159,12 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="BouncyCastle.Crypto, Version=1.8.2.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Portable.BouncyCastle.1.8.2\lib\netstandard1.0\BouncyCastle.Crypto.dll</HintPath>
|
||||
<Reference Include="BouncyCastle.Crypto, Version=1.8.3.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Portable.BouncyCastle.1.8.3\lib\netstandard1.0\BouncyCastle.Crypto.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="ModernKeePassLib, Version=2.37.0.2000, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ModernKeePassLib.2.38.2\lib\netstandard1.2\ModernKeePassLib.dll</HintPath>
|
||||
<Reference Include="ModernKeePassLib, Version=2.39.1.22027, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ModernKeePassLib.2.39.1\lib\netstandard1.2\ModernKeePassLib.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Splat, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
|
@@ -63,9 +63,10 @@ namespace ModernKeePassApp.Test
|
||||
{
|
||||
var databaseFile = Package.Current.InstalledLocation.GetFileAsync(@"Data\TestDatabase.kdbx")
|
||||
.GetAwaiter().GetResult();
|
||||
var openVm = new OpenVm(databaseFile);
|
||||
Assert.IsTrue(openVm.IsFileSelected);
|
||||
Assert.AreEqual("MockDatabase", openVm.Name);
|
||||
var openVm = new OpenVm();
|
||||
Assert.IsFalse(openVm.IsFileSelected);
|
||||
openVm.OpenFile(databaseFile, new RecentServiceMock());
|
||||
Assert.AreEqual("TestDatabase.kdbx", openVm.Name);
|
||||
}
|
||||
|
||||
/*[TestMethod]
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.NETCore.Platforms" version="2.1.0" targetFramework="win81" />
|
||||
<package id="Microsoft.NETCore.Platforms" version="2.1.1" targetFramework="win81" />
|
||||
<package id="Microsoft.NETCore.Portable.Compatibility" version="1.0.2" targetFramework="win81" />
|
||||
<package id="ModernKeePassLib" version="2.38.2" targetFramework="win81" />
|
||||
<package id="ModernKeePassLib" version="2.39.1" targetFramework="win81" />
|
||||
<package id="NETStandard.Library" version="2.0.3" targetFramework="win81" />
|
||||
<package id="Portable.BouncyCastle" version="1.8.2" targetFramework="win81" />
|
||||
<package id="Portable.BouncyCastle" version="1.8.3" targetFramework="win81" />
|
||||
<package id="Splat" version="3.0.0" targetFramework="win81" />
|
||||
<package id="System.Diagnostics.Contracts" version="4.3.0" targetFramework="win81" />
|
||||
<package id="System.Drawing.Primitives" version="4.3.0" targetFramework="win81" />
|
||||
|
Reference in New Issue
Block a user