WIP /search

This commit is contained in:
2024-03-24 16:53:12 +00:00
parent e229439174
commit aeecc524a4
34 changed files with 1188 additions and 391 deletions

View File

@ -1,12 +1,12 @@
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;
using isn.Abstract;
using System.Linq;
using Xunit;
using isn.abst;
using System.Security.Cryptography;
namespace isn.tests
{
@ -42,6 +42,18 @@ namespace isn.tests
var pub = model.Resources.FirstOrDefault((r) => r.Type.StartsWith("PackagePublish/"));
Assert.True(pub != null);
}
[Fact]
public void TestSetApiKey()
{
string source = "http://localhost:3002/v3/index.json";
var setting = Settings.Create();
setting.Sources[source] = new SourceSettings{ Url=source };
string testingKey = "CfDJ8LF3SbIJ4FJAgs7uIQKhdCAYCNVXRwU6TEoaXOo1_ZpG2u8TCGFP2z13hw9xR0LC0gdbr1QGwNndiXUl4DI74nxyBi-T1oC33PWtE-5vgiJWeCH223PYtoSEdzDiWovwJZWJbQON0WqoG8vSfbrBXTmicD6oxF4ghwXXexY0RiRR";
var rsa = RSA.Create(setting.RSAParameters);
setting.Sources[source].SetApiKey(rsa,testingKey);
Assert.Equal(testingKey, setting.Sources[source].GetClearApiKey(rsa));
}
}
}