예제 #1
0
        public void Serialization_PersistsArguments_NullClass()
        {
            PageInfo sourceEntry = new PageInfo("Page Name", (ClassState)null);

            byte[]   data     = SerializationHelper.SerializeToArray(sourceEntry);
            PageInfo newEntry = SerializationHelper.DeserializeFromArray <PageInfo>(data);

            Assert.Equal(null, newEntry.GetArguments <ClassState>());
        }
예제 #2
0
        public void Serialization_PersistsArguments_NullReturnsDefaultInt()
        {
            PageInfo sourceEntry = new PageInfo("Page Name", null);

            byte[]   data     = SerializationHelper.SerializeToArray(sourceEntry);
            PageInfo newEntry = SerializationHelper.DeserializeFromArray <PageInfo>(data);

            Assert.Equal(0, newEntry.GetArguments <int>());
        }
예제 #3
0
        public void Serialization_PersistsArguments_String()
        {
            PageInfo sourceEntry = new PageInfo("Page Name", "Arguments");

            byte[]   data     = SerializationHelper.SerializeToArray(sourceEntry);
            PageInfo newEntry = SerializationHelper.DeserializeFromArray <PageInfo>(data);

            Assert.Equal("Arguments", newEntry.GetArguments <string>());
        }
예제 #4
0
        public void Constructor_SetsArguments_Struct()
        {
            PageInfo navigationEntry = new PageInfo("Page Name", new StructState()
            {
                Text = "Text Value", Number = 42
            });

            var args = navigationEntry.GetArguments <StructState>();

            Assert.Equal("Text Value", args.Text);
            Assert.Equal(42, args.Number);
        }
예제 #5
0
        public void Serialization_PersistsArguments_Struct()
        {
            PageInfo sourceEntry = new PageInfo("Page Name", new StructState()
            {
                Text = "Text Value", Number = 42
            });

            byte[]   data     = SerializationHelper.SerializeToArray(sourceEntry);
            PageInfo newEntry = SerializationHelper.DeserializeFromArray <PageInfo>(data);

            var args = newEntry.GetArguments <StructState>();

            Assert.Equal("Text Value", args.Text);
            Assert.Equal(42, args.Number);
        }
예제 #6
0
        public void Constructor_SetsArguments_NullReturnsDefaultInt()
        {
            PageInfo navigationEntry = new PageInfo("Page Name", null);

            Assert.Equal(0, navigationEntry.GetArguments <int>());
        }
예제 #7
0
        public void Constructor_SetsArguments_NullClass()
        {
            PageInfo navigationEntry = new PageInfo("Page Name", (ClassState)null);

            Assert.Equal(null, navigationEntry.GetArguments <ClassState>());
        }
예제 #8
0
        public void Constructor_SetsArguments_Int()
        {
            PageInfo navigationEntry = new PageInfo("Page Name", 42);

            Assert.Equal(42, navigationEntry.GetArguments <int>());
        }
예제 #9
0
        public void Constructor_SetsArguments_NullString()
        {
            PageInfo navigationEntry = new PageInfo("Page Name", (string)null);

            Assert.Equal(null, navigationEntry.GetArguments <string>());
        }
예제 #10
0
        public void Constructor_SetsArguments_String()
        {
            PageInfo navigationEntry = new PageInfo("Page Name", "Arguments");

            Assert.Equal("Arguments", navigationEntry.GetArguments <string>());
        }