public void GivenUnaryExpressionWhenSerializedThenShouldDeserialize(UnaryExpression unary) { var json = Serializer.Serialize(unary); Reset(); var target = Serializer.Deserialize <UnaryExpression>(json); Assert.Equal(unary.Type, target.Type); Assert.Equal(unary.Operand?.NodeType, target.Operand?.NodeType); if (unary.Method != null) { Assert.Equal(unary.Method, target.Method); } Assert.True(unary.IsEquivalentTo(target)); }