Moving micasa 1.5 trunk to Novell forge.
This commit is contained in:
55
c_micasad/test/cache/TestSecret.cs
vendored
Normal file
55
c_micasad/test/cache/TestSecret.cs
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
#if DEBUG
|
||||
using System;
|
||||
using System.Text;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace sscs.cache
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
public class TestSecret
|
||||
{
|
||||
|
||||
[Test]
|
||||
public void DefaultAddSecret()
|
||||
{
|
||||
|
||||
string someotherstr = "newvalue";
|
||||
byte[] newval = Encoding.ASCII.GetBytes(someotherstr);
|
||||
|
||||
Secret mysec = new Secret();
|
||||
|
||||
mysec.SetKey("newkey");
|
||||
mysec.SetValue(newval);
|
||||
mysec.SetEpasswd("enhanced");
|
||||
mysec.SetKey("alternatekey");
|
||||
|
||||
Assert.AreEqual("newvalue", Encoding.ASCII.GetString(mysec.GetValue("alternatekey")));
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void TestAddSecret()
|
||||
{
|
||||
|
||||
string somestr = "novell123";
|
||||
string someotherstr = "newvalue";
|
||||
byte[] mybyte = Encoding.ASCII.GetBytes(somestr);
|
||||
byte[] newval = Encoding.ASCII.GetBytes(someotherstr);
|
||||
|
||||
Secret mysec = new Secret("mail", mybyte);
|
||||
mysec.SetKey("newkey");
|
||||
mysec.SetValue(newval);
|
||||
|
||||
Assert.AreEqual("newkey", mysec.GetKey());
|
||||
Assert.AreEqual("newvalue", Encoding.ASCII.GetString(mysec.GetValue()));
|
||||
|
||||
}
|
||||
|
||||
//TBD: Need to Add Timestamp related cases, could be done when we use it
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user