WIP /search
This commit is contained in:
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user