public void ByteArray()
    {
        var target = new ClassWithByteArray
        {
            Property = new byte[] { 2, 3 }
        };
        var result = RoundTrip.Run(target);

        CollectionAssert.AreEqual(new byte[] { 2, 3 }, result.Property);
    }
Esempio n. 2
0
    public async Task ByteArray()
    {
        var target = new ClassWithByteArray
        {
            Property = new byte[] { 2, 3 }
        };
        var result = await RoundTrip.Run(target);

        Assert.Equal(new byte[] { 2, 3 }, result.Property);
    }
Esempio n. 3
0
        public void SaveAndLoadClassWithEmptyByteArray()
        {
            var instance = new ClassWithByteArray {
                data = new byte[] { 1, 2, 3 }
            };
            var data      = BinaryDataExtensions.SaveDataIntoMemoryStream(instance);
            var retrieved =
                BinaryDataExtensions.LoadDataWithKnownTypeFromMemoryStream <ClassWithByteArray>(data);

            Assert.IsTrue(instance.data.Compare(retrieved.data));
        }
		public void SaveAndLoadClassWithEmptyByteArray()
		{
			var instance = new ClassWithByteArray { data = new byte[] { 1, 2, 3 } };
			var data = BinaryDataExtensions.SaveDataIntoMemoryStream(instance);
			var retrieved =
				BinaryDataExtensions.LoadDataWithKnownTypeFromMemoryStream<ClassWithByteArray>(data);
			Assert.IsTrue(instance.data.Compare(retrieved.data));
		}