예제 #1
0
        public void GenericHashSetWithProperties()
        {
            var expected = new HashSetWithProperties <string> {
                "Hello", "World", "Hope", "This", "Works!"
            };

            expected.Message = HelloWorld;
            expected.Number  = 6776;
            var data   = _serializer.Serialize(expected);
            var actual = _serializer.Deserialize <HashSetWithProperties <string> >(data);

            Assert.True(actual.SetEquals(expected));
            Assert.Equal(HelloWorld, actual.Message);
            Assert.Equal(6776, actual.Number);
        }
예제 #2
0
        public void GenericHashSetAttributes()
        {
            var serializer = new ConfigurationContainer()
                             .Type <SimpleSubject>()
                             .Member(x => x.Number, x => x.Attribute())
                             .Create();

            var expected = new HashSetWithProperties <string> {
                "Hello", "World", "Hope", "This", "Works!"
            };

            expected.Message = HelloWorld;
            expected.Number  = 6776;
            var data   = serializer.Serialize(expected);
            var actual = serializer.Deserialize <HashSetWithProperties <string> >(data);

            Assert.True(actual.SetEquals(expected));
            Assert.Equal(expected.Message, actual.Message);
            Assert.Equal(expected.Number, actual.Number);
        }