public void WhenSerializingNullObjectShouldReturnAnEmptyByteArray() { FakePoco fake = null; byte[] expected = new byte[] { }; var actual = _protoBufferSerializer.Serialize(fake); Assert.Equal(expected, actual); }
public void WhenSerializingValidObjectShouldDeserializeWithSuccessToTheSameTypeObject() { var expected = new FakePoco() { FakeString = "fake", FakeInt = 10 }; var serializedObject = _protoBufferSerializer.Serialize(expected); var actual = _protoBufferSerializer.Deserialize <FakePoco>(serializedObject); Assert.IsType <FakePoco>(actual); Assert.Equal(expected.FakeString, actual.FakeString); Assert.Equal(expected.FakeInt, actual.FakeInt); }