Re: Is.Serializable

"Charlie Poole" <[email protected]> Tue, 9 Sep 2008 04:09:08 -0700
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <005f01c9126c$7d2870a0$6401a8c0@ferrari>
This is a multi-part message in MIME format.

--===============1670390892==
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_0060_01C91231.D0C998A0"

This is a multi-part message in MIME format.

------=_NextPart_000_0060_01C91231.D0C998A0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

At some point, I decided NAnt should not be in the repositiory. But I can't
remember the reason any longer. :-)
 
Charlie


  _____  

From: [email protected]
[mailto:[email protected]] On Behalf Of Simone
Busoli
Sent: Tuesday, September 09, 2008 12:08 AM
To: Charlie Poole
Cc: [email protected]
Subject: Re: [Nunit-users] Is.Serializable


Well, NAnt should be in the repository, shouldn't it? 
Running the build with NAnt I get an error saying that it cannot find
resgen. Actually, I don't have the .NET SDK installed, I guess that's the
reason.


On Tue, Sep 9, 2008 at 1:57 AM, Charlie Poole <[email protected]>
wrote:


Hi Simone,
 
If there's something specific, I'd be glad to fix it. Right now, I believe
the onlly dependency is on
having a NAnt version that supports the script elements and an SDK for the
version of .NET or
Mono you want to use.. If there's anything else, it should be in our
repository.
 
What are you running into other than that?
 
Charlie


  _____  


From: [email protected]
[mailto:[email protected]] On Behalf Of Simone
Busoli

Sent: Monday, September 08, 2008 2:30 PM 

To: Charlie Poole
Cc: [email protected]
Subject: Re: [Nunit-users] Is.Serializable


Do you think that the nant script could be made less dependent upon the
machine on which it's run? Except for the net fx, I'd prefer if it didn't
have any other dependencies which could not be put under source control.


On Mon, Sep 8, 2008 at 11:12 PM, Charlie Poole <[email protected]>
wrote:


I find the VS builds convenient for exploratory changes myself.
 
For the NAnt build, make sure the config points to the right
location for the exe.
 
I seem to remember that there are problems when you have
a separate SDK install in additon to the version provided with
Visual Studio.
 
Charlie


  _____  


From: Simone Busoli [mailto:[email protected]] 

Sent: Monday, September 08, 2008 1:33 PM 

To: Charlie Poole
Cc: [email protected]
Subject: Re: [Nunit-users] Is.Serializable


I built it with VS2008 and ran tests with the NUnit gui executable output
from the build. 
The NAnt script requires the .NET SDK, I have it installed at work but I
couldn't run it anyway. It complained about resgen.exe not being there. In
fact it wasn't there, but I didn't investigate why.
I couldn't run the NAnt script however in the end, though I would prefer
running it instead of building in VS. 


On Mon, Sep 8, 2008 at 10:20 PM, Charlie Poole <[email protected]>
wrote:


How did you work out your build problem?
 
Charlie


  _____  


From: Simone Busoli [mailto:[email protected]] 

Sent: Monday, September 08, 2008 12:29 PM 

To: Charlie Poole
Cc: [email protected]
Subject: Re: [Nunit-users] Is.Serializable


So here's the patch, for both the BinarySerializable and XmlSerializable
constraints. I've followed your guide, I hope I did everything correctly.
Feedback welcome.


On Sun, Sep 7, 2008 at 7:35 PM, Charlie Poole <[email protected]>
wrote:


Fair Enough! I'll put it on both lists.
 
Charlie


  _____  


From: [email protected]
[mailto:[email protected]] On Behalf Of Simone
Busoli

Sent: Sunday, September 07, 2008 12:24 AM 

To: Charlie Poole
Cc: [email protected]
Subject: Re: [Nunit-users] Is.Serializable


Hi Charlie, 

I'd prefer to work on it again, there's been some changes since I wrote it
in the beginning, and it would be useful for me to get comfortable with
them. If you agree, I think this would be the right moment to publish the
list of steps required to create a new constraint.


On Sun, Sep 7, 2008 at 1:33 AM, Charlie Poole <[email protected]>
wrote:


Hi Simone,
 
I'm now back to looking at this patch, which I set aside while working on
other stuff.
 
I agree with you about having two different constraints. Do you want me to
put in
the patch you sent and change the name to "Binary..." or would you like to
rework it?
 
As noted, we do now have a generic AttributeConstraint.
 
Charlie


  _____  


From: Simone Busoli [mailto:[email protected]] 

Sent: Thursday, August 14, 2008 11:15 AM
To: Charlie Poole
Cc: [email protected] 

Subject: Re: [Nunit-users] Is.Serializable




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)


I think that making Is.Serializable check for the presence of the attribute
on the class might be misleading, because its presence doesn't mean it's
serializable, and its absence doesn't mean it isn't. I think that
Is.Serializable should be used to check that an object is really
serializable, together with its references. That is, Is.Serializable should
come in two flavours, one that checks if it is serializable in binary
format, and another for xml. I'll come to this later.
About checking for the presence of the attribute, as you mentioned in a
comment to Fabio's feature request, I think it could be generalized with
Has.Attribute<> or Has.Attribute(Type).
So, given that the presence of an attribute is checked with a generic
Has.Attribute, the way I would tackle the true ability of an object graph to
serialize is either using Is.XmlSerializable and Is.BinarySerializable or
something equivalent. I don't get how you could pass in an instance of a
formatter; I guess you proposed it because you might want to be able to use
the assertion for other types of formatters not built into the .net fx s
well, but then how would you call their methods? Via reflection?
 


 
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?


I'm fine with anything you choose. I don't think it's so important if it's a
property or a method, just let's try to be consistent :)
 


 

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.










------=_NextPart_000_0060_01C91231.D0C998A0
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.6000.16705" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D921400511-09092008><FONT face=3DArial color=3D#0000ff =
size=3D2>At=20
some point, I decided NAnt should not be in the repositiory. But I=20
can't</FONT></SPAN></DIV>
<DIV><SPAN class=3D921400511-09092008><FONT face=3DArial color=3D#0000ff =

size=3D2>remember the reason any longer. :-)</FONT></SPAN></DIV>
<DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT size=3D2><SPAN=20
class=3D921400511-09092008></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT size=3D2><SPAN=20
class=3D921400511-09092008>Charlie</SPAN></FONT></FONT></FONT></DIV>
<DIV><BR></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
solid; MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft>
  <HR tabIndex=3D-1>
  <FONT face=3DTahoma size=3D2><B>From:</B>=20
  [email protected]=20
  [mailto:[email protected]] <B>On Behalf Of =
</B>Simone=20
  Busoli<BR><B>Sent:</B> Tuesday, September 09, 2008 12:08 =
AM<BR><B>To:</B>=20
  Charlie Poole<BR><B>Cc:</B>=20
  [email protected]<BR><B>Subject:</B> Re: [Nunit-users] =

  Is.Serializable<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV dir=3Dltr>Well, NAnt should be in the repository, shouldn't it?
  <DIV>Running the build with NAnt I get an error saying that it cannot =
find=20
  resgen. Actually, I don't have the .NET SDK installed, I guess that's =
the=20
  reason.<BR><BR>
  <DIV class=3Dgmail_quote>On Tue, Sep 9, 2008 at 1:57 AM, Charlie Poole =
<SPAN=20
  dir=3Dltr>&lt;<A=20
  =
href=3D"mailto:[email protected]">[email protected]</=
A>&gt;</SPAN>=20
  wrote:<BR>
  <BLOCKQUOTE class=3Dgmail_quote=20
  style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: =
#ccc 1px solid">
    <DIV>
    <DIV><SPAN><FONT face=3DArial color=3D#0000ff size=3D2>Hi=20
    Simone,</FONT></SPAN></DIV>
    <DIV>&nbsp;</DIV>
    <DIV><SPAN></SPAN><FONT face=3DArial><FONT color=3D#0000ff><FONT =
size=3D2>I<SPAN>f=20
    there's something specific, I'd be glad to fix it. Right now, I =
believe the=20
    onlly dependency is on</SPAN></FONT></FONT></FONT></DIV>
    <DIV><FONT size=3D+0><FONT color=3D#0000ff><FONT=20
    size=3D2><SPAN></SPAN></FONT></FONT></FONT><SPAN></SPAN><FONT =
face=3DArial><FONT=20
    color=3D#0000ff><FONT size=3D2>h<SPAN>aving a NAnt version that =
supports the=20
    s</SPAN></FONT></FONT></FONT><FONT face=3DArial><FONT =
color=3D#0000ff><FONT=20
    size=3D2><SPAN>cript elements and an SDK for the version of .NET=20
    or</SPAN></FONT></FONT></FONT></DIV>
    <DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT =
size=3D2><SPAN>Mono you=20
    </SPAN></FONT></FONT></FONT><FONT face=3DArial><FONT =
color=3D#0000ff><FONT=20
    size=3D2><SPAN>want to use.. If there's anything else, it should be=20
    </SPAN></FONT></FONT></FONT><FONT face=3DArial><FONT =
color=3D#0000ff><FONT=20
    size=3D2><SPAN>in </SPAN></FONT></FONT></FONT><FONT =
face=3DArial><FONT=20
    color=3D#0000ff><FONT size=3D2>o<SPAN>ur=20
    repository.</SPAN></FONT></FONT></FONT></DIV>
    <DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT=20
    size=3D2><SPAN></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT =
size=3D2><SPAN>What are you=20
    running into other than that?</SPAN></FONT></FONT></FONT></DIV>
    <DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT=20
    size=3D2><SPAN></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT=20
    size=3D2><SPAN>Charlie</SPAN></FONT></FONT></FONT></DIV>
    <DIV><BR></DIV>
    <BLOCKQUOTE dir=3Dltr=20
    style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff =
2px solid; MARGIN-RIGHT: 0px">
      <DIV lang=3Den-us dir=3Dltr align=3Dleft>
      <HR>
      <FONT face=3DTahoma size=3D2>
      <DIV class=3DIh2E3d><B>From:</B> <A=20
      href=3D"mailto:[email protected]"=20
      target=3D_blank>[email protected]</A> =
[mailto:<A=20
      href=3D"mailto:[email protected]"=20
      target=3D_blank>[email protected]</A>] =
<B>On Behalf=20
      Of </B>Simone Busoli<BR></DIV><B>Sent:</B> Monday, September 08, =
2008 2:30=20
      PM
      <DIV>
      <DIV></DIV>
      <DIV class=3DWj3C7c><BR><B>To:</B> Charlie Poole<BR><B>Cc:</B> <A=20
      href=3D"mailto:[email protected]"=20
      =
target=3D_blank>[email protected]</A><BR><B>Subject:</B> =
Re:=20
      [Nunit-users] Is.Serializable<BR></DIV></DIV></FONT><BR></DIV>
      <DIV>
      <DIV></DIV>
      <DIV class=3DWj3C7c>
      <DIV></DIV>
      <DIV dir=3Dltr>Do you think that the nant script could be made =
less=20
      dependent upon the machine on which it's run? Except for the net =
fx, I'd=20
      prefer if it didn't have any other dependencies which could not be =
put=20
      under source control.<BR><BR>
      <DIV class=3Dgmail_quote>On Mon, Sep 8, 2008 at 11:12 PM, Charlie =
Poole=20
      <SPAN dir=3Dltr>&lt;<A href=3D"mailto:[email protected]" =

      target=3D_blank>[email protected]</A>&gt;</SPAN> =
wrote:<BR>
      <BLOCKQUOTE class=3Dgmail_quote=20
      style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; =
BORDER-LEFT: #ccc 1px solid">
        <DIV>
        <DIV><SPAN><FONT face=3DArial color=3D#0000ff size=3D2>I find =
the VS builds=20
        convenient for exploratory changes myself.</FONT></SPAN></DIV>
        <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
        size=3D2></FONT></SPAN>&nbsp;</DIV>
        <DIV><SPAN><FONT face=3DArial color=3D#0000ff size=3D2>For the =
NAnt build,=20
        make sure the config points to the right</FONT></SPAN></DIV>
        <DIV><SPAN><FONT face=3DArial color=3D#0000ff size=3D2>location =
for the=20
        exe.</FONT></SPAN></DIV>
        <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
        size=3D2></FONT></SPAN>&nbsp;</DIV>
        <DIV><SPAN><FONT face=3DArial color=3D#0000ff size=3D2>I seem to =
remember that=20
        there are problems when you have</FONT></SPAN></DIV>
        <DIV><SPAN><FONT face=3DArial color=3D#0000ff size=3D2>a =
separate SDK install=20
        in additon to the version provided with</FONT></SPAN></DIV>
        <DIV><SPAN><FONT face=3DArial color=3D#0000ff size=3D2>Visual=20
        Studio.</FONT></SPAN></DIV>
        <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
        size=3D2></FONT></SPAN>&nbsp;</DIV>
        <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
        size=3D2>Charlie</FONT></SPAN></DIV><BR>
        <BLOCKQUOTE dir=3Dltr=20
        style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: =
#0000ff 2px solid; MARGIN-RIGHT: 0px">
          <DIV lang=3Den-us dir=3Dltr align=3Dleft>
          <HR>
          <FONT face=3DTahoma size=3D2>
          <DIV><B>From:</B> Simone Busoli [mailto:<A=20
          href=3D"mailto:[email protected]"=20
          target=3D_blank>[email protected]</A>] =
<BR></DIV><B>Sent:</B>=20
          Monday, September 08, 2008 1:33 PM=20
          <DIV>
          <DIV></DIV>
          <DIV><BR><B>To:</B> Charlie Poole<BR><B>Cc:</B> <A=20
          href=3D"mailto:[email protected]"=20
          =
target=3D_blank>[email protected]</A><BR><B>Subject:</B> =

          Re: [Nunit-users] =
Is.Serializable<BR></DIV></DIV></FONT><BR></DIV>
          <DIV>
          <DIV></DIV>
          <DIV>
          <DIV></DIV>
          <DIV dir=3Dltr>I built it with VS2008 and ran tests with the =
NUnit gui=20
          executable output from the build.=20
          <DIV>The NAnt script requires the .NET SDK, I have it =
installed at=20
          work but I couldn't run it anyway. It complained about =
resgen.exe not=20
          being there. In fact it wasn't there, but I didn't investigate =

          why.</DIV>
          <DIV>I couldn't run the NAnt script however in the end, though =
I would=20
          prefer running it instead of building in VS.&nbsp;<BR><BR>
          <DIV class=3Dgmail_quote>On Mon, Sep 8, 2008 at 10:20 PM, =
Charlie Poole=20
          <SPAN dir=3Dltr>&lt;<A =
href=3D"mailto:[email protected]"=20
          target=3D_blank>[email protected]</A>&gt;</SPAN> =
wrote:<BR>
          <BLOCKQUOTE class=3Dgmail_quote=20
          style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; =
BORDER-LEFT: #ccc 1px solid">
            <DIV>
            <DIV><SPAN><FONT face=3DArial color=3D#0000ff size=3D2>How =
did you work=20
            out your build problem?</FONT></SPAN></DIV>
            <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
            size=3D2></FONT></SPAN>&nbsp;</DIV>
            <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
            size=3D2>Charlie</FONT></SPAN></DIV><BR>
            <BLOCKQUOTE dir=3Dltr=20
            style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: =
#0000ff 2px solid; MARGIN-RIGHT: 0px">
              <DIV lang=3Den-us dir=3Dltr align=3Dleft>
              <HR>
              <FONT face=3DTahoma size=3D2>
              <DIV><B>From:</B> Simone Busoli [mailto:<A=20
              href=3D"mailto:[email protected]"=20
              target=3D_blank>[email protected]</A>] =
<BR></DIV><B>Sent:</B>=20
              Monday, September 08, 2008 12:29 PM=20
              <DIV>
              <DIV></DIV>
              <DIV><BR><B>To:</B> Charlie Poole<BR><B>Cc:</B> <A=20
              href=3D"mailto:[email protected]"=20
              =
target=3D_blank>[email protected]</A><BR><B>Subject:</B> =

              Re: [Nunit-users] =
Is.Serializable<BR></DIV></DIV></FONT><BR></DIV>
              <DIV>
              <DIV></DIV>
              <DIV>
              <DIV></DIV>
              <DIV dir=3Dltr>So here's the patch, for both the =
BinarySerializable=20
              and XmlSerializable constraints. I've followed your guide, =
I hope=20
              I did everything correctly. Feedback welcome.<BR><BR>
              <DIV class=3Dgmail_quote>On Sun, Sep 7, 2008 at 7:35 PM, =
Charlie=20
              Poole <SPAN dir=3Dltr>&lt;<A=20
              href=3D"mailto:[email protected]"=20
              target=3D_blank>[email protected]</A>&gt;</SPAN> =

wrote:<BR>
              <BLOCKQUOTE class=3Dgmail_quote=20
              style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; =
BORDER-LEFT: #ccc 1px solid">
                <DIV>
                <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>Fair Enough!=20
                I'll put it on both lists.</FONT></SPAN></DIV>
                <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
                size=3D2></FONT></SPAN>&nbsp;</DIV>
                <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
                size=3D2>Charlie</FONT></SPAN></DIV><BR>
                <BLOCKQUOTE dir=3Dltr=20
                style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
                  <DIV lang=3Den-us dir=3Dltr align=3Dleft>
                  <HR>
                  <FONT face=3DTahoma size=3D2>
                  <DIV><B>From:</B> <A=20
                  =
href=3D"mailto:[email protected]"=20
                  =
target=3D_blank>[email protected]</A>=20
                  [mailto:<A=20
                  =
href=3D"mailto:[email protected]"=20
                  =
target=3D_blank>[email protected]</A>]=20
                  <B>On Behalf Of </B>Simone =
Busoli<BR></DIV><B>Sent:</B>=20
                  Sunday, September 07, 2008 12:24 AM=20
                  <DIV>
                  <DIV></DIV>
                  <DIV><BR><B>To:</B> Charlie Poole<BR><B>Cc:</B> <A=20
                  href=3D"mailto:[email protected]"=20
                  =
target=3D_blank>[email protected]</A><BR><B>Subject:</B> =

                  Re: [Nunit-users]=20
                  Is.Serializable<BR></DIV></DIV></FONT><BR></DIV>
                  <DIV>
                  <DIV></DIV>
                  <DIV>
                  <DIV></DIV>
                  <DIV dir=3Dltr>Hi Charlie,=20
                  <DIV><BR></DIV>
                  <DIV>I'd prefer to work on it again, there's been some =
changes=20
                  since I wrote it in the beginning, and it would be =
useful for=20
                  me to get comfortable with them. If you agree, I think =
this=20
                  would be the right moment to publish the list of steps =

                  required to create a new constraint.<BR><BR>
                  <DIV class=3Dgmail_quote>On Sun, Sep 7, 2008 at 1:33 =
AM, Charlie=20
                  Poole <SPAN dir=3Dltr>&lt;<A=20
                  href=3D"mailto:[email protected]"=20
                  =
target=3D_blank>[email protected]</A>&gt;</SPAN>=20
                  wrote:<BR>
                  <BLOCKQUOTE class=3Dgmail_quote=20
                  style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; =
BORDER-LEFT: #ccc 1px solid">
                    <DIV>
                    <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>Hi=20
                    Simone,</FONT></SPAN></DIV>
                    <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
                    size=3D2></FONT></SPAN>&nbsp;</DIV>
                    <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>I'm now=20
                    back to looking at this patch, which I set aside =
while=20
                    working on other stuff.</FONT></SPAN></DIV>
                    <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
                    size=3D2></FONT></SPAN>&nbsp;</DIV>
                    <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>I agree=20
                    with you about having two different constraints. Do =
you want=20
                    me to put in</FONT></SPAN></DIV>
                    <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>the patch=20
                    you sent and change the name to "Binary..."&nbsp;or =
would=20
                    you like to rework it?</FONT></SPAN></DIV>
                    <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
                    size=3D2></FONT></SPAN>&nbsp;</DIV>
                    <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>As noted,=20
                    we do now have a generic=20
                    AttributeConstraint.</FONT></SPAN></DIV>
                    <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
                    size=3D2></FONT></SPAN>&nbsp;</DIV>
                    <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
                    size=3D2>Charlie</FONT></SPAN></DIV><BR>
                    <BLOCKQUOTE dir=3Dltr=20
                    style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
                      <DIV lang=3Den-us dir=3Dltr align=3Dleft>
                      <HR>
                      <FONT face=3DTahoma size=3D2>
                      <DIV><B>From:</B> Simone Busoli [mailto:<A=20
                      href=3D"mailto:[email protected]"=20
                      target=3D_blank>[email protected]</A>]=20
                      <BR></DIV><B>Sent:</B> Thursday, August 14, 2008 =
11:15=20
                      AM<BR><B>To:</B> Charlie Poole<BR><B>Cc:</B> <A=20
                      href=3D"mailto:[email protected]"=20
                      =
target=3D_blank>[email protected]</A>=20
                      <DIV>
                      <DIV></DIV>
                      <DIV><BR><B>Subject:</B> Re: [Nunit-users]=20
                      Is.Serializable<BR></DIV></DIV></FONT><BR></DIV>
                      <DIV>
                      <DIV></DIV>
                      <DIV>
                      <DIV></DIV>
                      <DIV dir=3Dltr>
                      <DIV class=3Dgmail_quote>
                      <BLOCKQUOTE class=3Dgmail_quote=20
                      style=3D"PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt =
0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
                        <DIV><BR>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>To=20
                        check just for the attribute or the=20
                        interface</FONT></SPAN></DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>&nbsp;=20
                        Is.Serializable() OR</FONT></SPAN></DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>&nbsp;=20
                        Is.Serializable</FONT></SPAN></DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
                        size=3D2></FONT></SPAN>&nbsp;</DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>To=20
                        check by trying to do it</FONT></SPAN></DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>&nbsp;=20
                        Is.Serializable(formatter) =
OR</FONT></SPAN></DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>&nbsp;=20
                        =
Is.Serializable.Using(formatter)</FONT></SPAN></DIV></DIV></BLOCKQUOTE>
                      <DIV><BR>I think that making Is.Serializable check =
for the=20
                      presence of the attribute on the class might be=20
                      misleading, because its presence doesn't mean it's =

                      serializable, and its absence doesn't mean it =
isn't. I=20
                      think that Is.Serializable should be used to check =
that an=20
                      object is really serializable, together with its=20
                      references. That is, Is.Serializable should come =
in two=20
                      flavours, one that checks if it is serializable in =
binary=20
                      format, and another for xml. I'll come to this=20
                      later.<BR>About checking for the presence of the=20
                      attribute, as you mentioned in a comment to =
Fabio's=20
                      feature request, I think it could be generalized =
with=20
                      Has.Attribute&lt;&gt; or =
Has.Attribute(Type).<BR>So, given=20
                      that the presence of an attribute is checked with =
a=20
                      generic Has.Attribute, the way I would tackle the =
true=20
                      ability of an object graph to serialize is either =
using=20
                      Is.XmlSerializable and Is.BinarySerializable or =
something=20
                      equivalent. I don't get how you could pass in an =
instance=20
                      of a formatter; I guess you proposed it because =
you might=20
                      want to be able to use the assertion for other =
types of=20
                      formatters not built into the .net fx s well, but =
then how=20
                      would you call their methods? Via=20
                      reflection?<BR>&nbsp;</DIV>
                      <BLOCKQUOTE class=3Dgmail_quote=20
                      style=3D"PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt =
0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
                        <DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
                        size=3D2></FONT></SPAN></DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
                        size=3D2></FONT></SPAN>&nbsp;</DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>The=20
                        aternatives above are between using a method and =
using a=20
                        property. It would be</FONT></SPAN></DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>cool to=20
                        use the property for te first example and the =
method for=20
                        the second, but </FONT></SPAN></DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>that's=20
                        not possible.</FONT></SPAN></DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
                        size=3D2></FONT></SPAN>&nbsp;</DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>Most of=20
                        our syntactic elements use a property format =
when there=20
                        is no argument.</FONT></SPAN></DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>When an=20
                        element has an optional argument, then we are =
forced to=20
                        use method</FONT></SPAN></DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>syntax,=20
                        which may look a bit odd. For example, we have =
to=20
                        use</FONT></SPAN><SPAN><FONT face=3DArial =
color=3D#0000ff=20
                        size=3D2> Is.Ordered()</FONT></SPAN></DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>rather=20
                        than Is.Ordered - That example should be =
familiar to you=20
                        :-)</FONT></SPAN></DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
                        size=3D2></FONT></SPAN>&nbsp;</DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>I lean=20
                        toward "Using" or "With" or some other=20
                        keyword.</FONT></SPAN></DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
                        size=3D2></FONT></SPAN>&nbsp;</DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff =
size=3D2>What do=20
                        folks =
think?</FONT></SPAN></DIV></DIV></BLOCKQUOTE>
                      <DIV><BR>I'm fine with anything you choose. I =
don't think=20
                      it's so important if it's a property or a method, =
just=20
                      let's try to be consistent :)<BR>&nbsp;</DIV>
                      <BLOCKQUOTE class=3Dgmail_quote=20
                      style=3D"PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt =
0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
                        <DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
                        size=3D2></FONT></SPAN></DIV>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
                        size=3D2></FONT></SPAN>&nbsp;</DIV><FONT =
color=3D#888888>
                        <DIV><SPAN><FONT face=3DArial color=3D#0000ff=20
                        size=3D2>Charlie</FONT></SPAN></DIV><BR></FONT>
                        <BLOCKQUOTE dir=3Dltr=20
                        style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,255) 2px solid; MARGIN-RIGHT: 0px">
                          <DIV>
                          <DIV lang=3Den-us dir=3Dltr align=3Dleft>
                          <HR>
                          <FONT face=3DTahoma size=3D2><B>From:</B> =
Simone Busoli=20
                          [mailto:<A =
href=3D"mailto:[email protected]"=20
                          target=3D_blank>[email protected]</A>]=20
                          <BR><B>Sent:</B> Thursday, August 14, 2008 =
12:16=20
                          AM<BR><B>To:</B> Charlie =
Poole<BR><B>Subject:</B> Re:=20
                          [Nunit-users] =
Is.Serializable<BR></FONT><BR></DIV>
                          <DIV></DIV></DIV>
                          <DIV>
                          <DIV></DIV>
                          <DIV>
                          <DIV dir=3Dltr>Hmm, I just realized that what =
I'm doing=20
                          is not enough for the object to be =
serializable. I=20
                          noticed that the prerequisites for it to be=20
                          serializable are quite different according to =
whether=20
                          you want to serialize it to xml or to binary. =
For=20
                          example, the binary serialization doesn't =
require=20
                          classes to be public, while xml does. xml=20
                          serialization doesn't require the serializable =

                          attribute, while the binary does. So I'm =
wondering if=20
                          it could be the case to split the assertion in =

                          IsBinarySerializable and IsXmlSerializable, or =
check=20
                          that it is both binary and xml serializable in =
the=20
                          same assertion. Thoughts?<BR><BR>
                          <DIV class=3Dgmail_quote>On Thu, Aug 14, 2008 =
at 2:02=20
                          AM, Charlie Poole <SPAN dir=3Dltr>&lt;<A=20
                          href=3D"mailto:[email protected]"=20
                          =
target=3D_blank>[email protected]</A>&gt;</SPAN>=20
                          wrote:<BR>
                          <BLOCKQUOTE class=3Dgmail_quote=20
                          style=3D"PADDING-LEFT: 1ex; MARGIN: 0pt 0pt =
0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
                            <DIV>
                            <DIV><SPAN><FONT face=3DArial =
color=3D#0000ff size=3D2>Hi=20
                            Simone,</FONT></SPAN></DIV>
                            <DIV><SPAN><FONT face=3DArial =
color=3D#0000ff=20
                            size=3D2></FONT></SPAN>&nbsp;</DIV>
                            <DIV><SPAN><FONT face=3DArial =
color=3D#0000ff=20
                            size=3D2>This looks good to me. Would you =
like to=20
                            synch up and fix it so it works with the =
latest=20
                            code? My major</FONT></SPAN></DIV>
                            <DIV><SPAN><FONT face=3DArial =
color=3D#0000ff=20
                            size=3D2>changes to Constraint, =
ConstraintBuilder,=20
                            etc. are done and it would give you a good =
way for=20
                            you</FONT></SPAN></DIV>
                            <DIV><SPAN><FONT face=3DArial =
color=3D#0000ff size=3D2>to=20
                            get familiar with those changes. Once it's =
done, you=20
                            can either send me a new patch or -=20
                            if</FONT></SPAN></DIV>
                            <DIV><SPAN><FONT face=3DArial =
color=3D#0000ff size=3D2>you=20
                            would like - I'll make you a commiter so you =
can add=20
                            it yourself. If you agree, I'll explain=20
                            more</FONT></SPAN></DIV>
                            <DIV><SPAN><FONT face=3DArial =
color=3D#0000ff size=3D2>to=20
                            you about review of code =
etc.</FONT></SPAN></DIV>
                            <DIV>&nbsp;</DIV>
                            <DIV><SPAN></SPAN><FONT face=3DArial><FONT=20
                            color=3D#0000ff><FONT=20
                            =
size=3D2>C<SPAN>harlie</SPAN></FONT></FONT></FONT><BR></DIV>
                            <BLOCKQUOTE dir=3Dltr=20
                            style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: rgb(0,0,255) 2px solid; MARGIN-RIGHT: 0px">
                              <DIV lang=3Den-us dir=3Dltr align=3Dleft>
                              <HR>
                              <FONT face=3DTahoma size=3D2><B>From:</B> =
<A=20
                              =
href=3D"mailto:[email protected]"=20
                              =
target=3D_blank>[email protected]</A>=20
                              [mailto:<A=20
                              =
href=3D"mailto:[email protected]"=20
                              =
target=3D_blank>[email protected]</A>]=20
                              <B>On Behalf Of </B>Simone =
Busoli<BR><B>Sent:</B>=20
                              Monday, August 11, 2008 7:11 =
AM<BR><B>To:</B> <A=20
                              =
href=3D"mailto:[email protected]"=20
                              =
target=3D_blank>[email protected]</A><BR><B>Subject:</B> =

                              [Nunit-users] =
Is.Serializable<BR></FONT><BR></DIV>
                              <DIV>
                              <DIV></DIV>
                              <DIV dir=3Dltr>With regards to: <A=20
                              =
href=3D"http://sourceforge.net/tracker/index.php?func=3Ddetail&amp;aid=3D=
2028517&amp;group_id=3D10749&amp;atid=3D360749"=20
                              =
target=3D_blank>http://sourceforge.net/tracker/index.php?func=3Ddetail&am=
p;aid=3D2028517&amp;group_id=3D10749&amp;atid=3D360749</A><BR><BR>I=20
                              have implemented a SerializableConstraint=20
                              accessible via Is.Serializable. The match =
is true=20
                              if serialization to and deserialization =
from a=20
                              memory stream via a BinaryFormatter both =
succeed=20
                              and the deserialized object is not null. =
Otherwise=20
                              the match returns=20
                            =
false.<BR></DIV></DIV></BLOCKQUOTE></DIV></BLOCKQUOTE></DIV><BR></DIV></D=
IV></DIV></BLOCKQUOTE></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></BL=
OCKQUOTE></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></DIV></BLOCKQUOT=
E></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></BLOCKQUOTE></DIV></BLO=
CKQUOTE></DIV><BR></DIV></DIV></DIV></DIV></BLOCKQUOTE></DIV></BLOCKQUOTE=
></DIV><BR></DIV></DIV></DIV></BLOCKQUOTE></DIV></BLOCKQUOTE></DIV><BR></=
DIV></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0060_01C91231.D0C998A0--




--===============1670390892==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
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=/
--===============1670390892==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Nunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nunit-users

--===============1670390892==--