Implement serialization of Settings and SettingsRepository.
- FIX: Stile werden jetzt gespeichert.
This commit is contained in:
@ -27,7 +27,7 @@ namespace Tests.Controller
|
||||
[TestFixture]
|
||||
class SettingsRepositoryTest
|
||||
{
|
||||
SettingsRepository _savedSettings;
|
||||
string _savedSettings;
|
||||
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
|
@ -22,6 +22,7 @@ using System.Text;
|
||||
using NUnit.Framework;
|
||||
using zaaReloaded2.Controller;
|
||||
using zaaReloaded2.Controller.Elements;
|
||||
using System.IO;
|
||||
|
||||
namespace Tests.Controller
|
||||
{
|
||||
@ -49,5 +50,21 @@ namespace Tests.Controller
|
||||
((Items)clone.Elements[1]).Content,
|
||||
"Items content");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PersistSettings()
|
||||
{
|
||||
string name = "hello world";
|
||||
Settings persisting = new Settings(name, new List<ElementBase>() { new Items() });
|
||||
persisting.ReferenceStyle = zaaReloaded2.Formatter.ReferenceStyle.IfSpecialItem;
|
||||
MemoryStream s = new MemoryStream();
|
||||
persisting.Persist(s);
|
||||
s.Position = 0;
|
||||
Settings retrieved = Settings.Unpersist(s);
|
||||
|
||||
Assert.AreEqual(persisting.Name, retrieved.Name, "Name");
|
||||
Assert.AreEqual(persisting.ReferenceStyle, retrieved.ReferenceStyle, "ReferenceStyle");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user