Re: Is.Serializable
"Charlie Poole" <[email protected]> Thu, 14 Aug 2008 10:07:59 -0700
| Newsgroups | gmane.comp.windows.dotnet.nunit.user |
|---|---|
| Message-ID | <004901c8fe30$52b4e010$6401a8c0@ferrari> |
Hi Simone, Putting us back on the list so we can (hopefully) get more input Here's what I think would be useful... Some people may just want to check that the type is marked as serializable. Fabio's request, in fact, suggests that. Others will want to do a full check, using a particular formatter. One way to do that would be for them to pass in the formatter as an argument. So... To check just for the attribute or the interface Is.Serializable() OR Is.Serializable To check by trying to do it Is.Serializable(formatter) OR Is.Serializable.Using(formatter) The aternatives above are between using a method and using a property. It would be cool to use the property for te first example and the method for the second, but that's not possible. Most of our syntactic elements use a property format when there is no argument. When an element has an optional argument, then we are forced to use method syntax, which may look a bit odd. For example, we have to use Is.Ordered() rather than Is.Ordered - That example should be familiar to you :-) I lean toward "Using" or "With" or some other keyword. What do folks think? Charlie _____ From: Simone Busoli [mailto:[email protected]] Sent: Thursday, August 14, 2008 12:16 AM To: Charlie Poole Subject: Re: [Nunit-users] Is.Serializable Hmm, I just realized that what I'm doing is not enough for the object to be serializable. I noticed that the prerequisites for it to be serializable are quite different according to whether you want to serialize it to xml or to binary. For example, the binary serialization doesn't require classes to be public, while xml does. xml serialization doesn't require the serializable attribute, while the binary does. So I'm wondering if it could be the case to split the assertion in IsBinarySerializable and IsXmlSerializable, or check that it is both binary and xml serializable in the same assertion. Thoughts? On Thu, Aug 14, 2008 at 2:02 AM, Charlie Poole <[email protected]> wrote: Hi Simone, This looks good to me. Would you like to synch up and fix it so it works with the latest code? My major changes to Constraint, ConstraintBuilder, etc. are done and it would give you a good way for you to get familiar with those changes. Once it's done, you can either send me a new patch or - if you would like - I'll make you a commiter so you can add it yourself. If you agree, I'll explain more to you about review of code etc. Charlie _____ From: [email protected] [mailto:[email protected]] On Behalf Of Simone Busoli Sent: Monday, August 11, 2008 7:11 AM To: [email protected] Subject: [Nunit-users] Is.Serializable With regards to: http://sourceforge.net/tracker/index.php?func=detail <http://sourceforge.net/tracker/index.php?func=detail&aid=2028517&group_id=1 0749&atid=360749> &aid=2028517&group_id=10749&atid=360749 I have implemented a SerializableConstraint accessible via Is.Serializable. The match is true if serialization to and deserialization from a memory stream via a BinaryFormatter both succeed and the deserialized object is not null. Otherwise the match returns false. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Nunit-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nunit-users