예제 #1
0
        public void TestSerializesProperties()
        {
            var instance = new ClassWithProperties {
                A = 1,
                B = 2,
                C = "foo"
            };

            Serializer.Bind(() => instance.A);
            Serializer.Bind(() => instance.B);
            Serializer.Bind(() => instance.C);

            Scheduler.WaitFor(Serializer.Save());

            Assert.AreEqual(1, (int)Scheduler.WaitFor(Tangle.Get("A")));
            Assert.AreEqual(2, (int)Scheduler.WaitFor(Tangle.Get("B")));
            Assert.AreEqual("foo", (string)Scheduler.WaitFor(Tangle.Get("C")));
        }
예제 #2
0
 private void OK_Click(object sender, EventArgs e)
 {
     Program.Scheduler.WaitFor(PreferenceSerializer.Save());
 }