Exemplo n.º 1
0
    public void TimeRangeValue()
    {
        TimeRangeValue input = TimeRangeSample;

        serializer.Save(Call, input);
        var output = serializer.Load <TimeRangeValue>(Call);
    }
Exemplo n.º 2
0
    public void SerializeInt()
    {
        int input = 5;

        _serializer.Save(Call, input);
        int output = _serializer.Load <int>(Call);

        Assert.AreEqual(input, output);
    }
Exemplo n.º 3
0
    public void SerializeDateTimeLocal()
    {
        DateTime input = DateTime.Now;

        _serializer.Save(Call, input);
        DateTime output = _serializer.Load <DateTime>(Call);

        Assert.AreEqual(input, output);
    }
Exemplo n.º 4
0
    public void SerializeAttributeNonSerialized()
    {
        var input = new NonSerializedTest()
        {
            NonSerialized = 5,
            Serialized    = 10,
        };

        _serializer.Save(Call, input);
        var output = _serializer.Load <NonSerializedTest>(Call);

        Assert.AreEqual(output.NonSerialized, 1);
        Assert.AreEqual(output.Serialized, 10);
    }
Exemplo n.º 5
0
    public void SerializeBookmark()
    {
        var input = new Bookmark()
        {
            TabBookmark = new TabBookmark()
            {
                ChildBookmarks = new Dictionary <string, TabBookmark>()
                {
                    { "test", new TabBookmark() }
                }
            },
        };

        input.TabBookmark.Bookmark = input;
        serializer.Save(Call, input);
        Bookmark output = serializer.Load <Bookmark>(Call);

        Assert.NotNull(output);
        Assert.NotNull(output.TabBookmark);
        Assert.NotNull(output.TabBookmark.ChildBookmarks);
        Assert.AreEqual(1, output.TabBookmark.ChildBookmarks.Count);
    }