public void GetObject_TestSetterClassByteStreamProvided_MatchingTestSetterRemovedClassInstanceReturned()
        {
            Serializer      serializer = new Serializer();
            TestSetterClass testClass  = new TestSetterClass()
            {
                IntProperty     = 1,
                FloatProperty   = 2.0f,
                StringProperty  = "Test String",
                GuidProperty    = Guid.NewGuid(),
                IntListProperty = new List <int>()
                {
                    1, 2, 3
                },
                IntArrayProperty   = new int[] { 3, 2, 1 },
                DictionaryProperty = new Dictionary <int, string>()
                {
                    { 1, "One" }, { 2, "Two" }
                },
                ObjectProperty = new Tuple <int, int>(1, 2)
            };

            byte[] bytes = serializer.GetObjectBytes(testClass, Endianness.LittleEndian, false);

            MemoryStream           memoryStream = new MemoryStream(bytes);
            TestSetterRemovedClass result       = serializer.GetObject(typeof(TestSetterRemovedClass), memoryStream, Endianness.LittleEndian, true) as TestSetterRemovedClass;

            memoryStream.Dispose();

            Assert.AreEqual(testClass.IntProperty, result.IntProperty);
            Assert.AreEqual(testClass.StringProperty, result.StringProperty);
            Assert.AreEqual(testClass.GuidProperty, result.GuidProperty);
        }
 public TestConstructorAddedClass(bool boolProperty, int intProperty, string stringProperty,
                                  TestSetterClass testSetterClassProperty)
 {
     BoolProperty            = boolProperty;
     IntProperty             = intProperty;
     StringProperty          = stringProperty;
     TestSetterClassProperty = testSetterClassProperty;
 }
        public void GetObject_TestSetterClassCaseSensitivePropertyNames_PropertyNotSet()
        {
            Serializer      serializer = new Serializer();
            TestSetterClass testClass  = new TestSetterClass()
            {
                IntProperty = 1
            };

            byte[] bytes = serializer.GetObjectBytes(testClass, Endianness.LittleEndian, false);

            MemoryStream memoryStream           = new MemoryStream(bytes);
            TestSetterCaseSensitiveClass result = serializer.GetObject(typeof(TestSetterCaseSensitiveClass), memoryStream, Endianness.LittleEndian, false) as TestSetterCaseSensitiveClass;

            memoryStream.Dispose();

            Assert.AreNotEqual(testClass.IntProperty, result.intProperty);
        }