Closed GoogleCodeExporter closed 8 years ago
Original comment by jeff.br...@gmail.com
on 30 Oct 2007 at 2:25
Original comment by jeff.br...@gmail.com
on 6 Jan 2008 at 7:19
Original comment by jeff.br...@gmail.com
on 17 Mar 2008 at 10:50
Something to think about so we can replace XmlAssert.
Original comment by jeff.br...@gmail.com
on 18 Sep 2008 at 8:17
Let's see what we can do for v3.0.7 or v3.0.8.
Original comment by jeff.br...@gmail.com
on 26 Apr 2009 at 8:11
The more I think about this, the more I think it should be .Net 3.5 only so we
can
use LINQ syntax for diffing XML trees (or other data structures like with the
structural equality comparer, maybe?)
Original comment by jeff.br...@gmail.com
on 16 Jun 2009 at 7:44
Original comment by jeff.br...@gmail.com
on 29 Jun 2009 at 8:33
The main reason I wanted to do this was so that we could deprecate and remove
the old
Xml testing feature. However it seems that tests involving Xml are not too
common or
else people have effective ways of writing them. We should perhaps just leave
this
out until we get a solid feature request from a user.
Original comment by jeff.br...@gmail.com
on 18 Jul 2009 at 5:06
Assert.Xml.AreEqual complete.
Original comment by Yann.Tre...@gmail.com
on 14 Sep 2009 at 6:46
:-)
What's next?
Original comment by jeff.br...@gmail.com
on 14 Sep 2009 at 7:12
Mmh... That's a good question :)
Either we continue to work on solutions for testing XML in general (schemas,
etc.), or
we focus on more specialized features for XML-based things like SOAP or HTML.
Original comment by Yann.Tre...@gmail.com
on 18 Sep 2009 at 5:30
To give you guys a scenario of what I envision us doing (in our company):
We have DB structure, fills and migration steps defined in XML files. Between
various
versions, service packs and customizations, merging is more or less 'hell' when
it
comes to these XML's. My idea is to - per build - keep unit tests on these
XML's, so
that I can always verify that all required content is there after a merge.
Doesn't have to be anything except the basic "check if element exists/doesn't
exist",
"check attribute of element x", "element uniqueness", etc. Some of these things
can
be checked by applying a schema, but for one or two reasons, this is not
practical
(and in some cases, not even possible) for us. I.e support a subset of common
XSD
validations.
Original comment by mikael.r...@gmail.com
on 18 Sep 2009 at 6:24
Oh thank you so much for your feedback, Mikael.
Testing subsets of XML fragments for various matches and criteria could be
indeed
very interesting. More specifically, do you have some idea how the assertions
would
look like? How could we specify the location of an element/attribute to check?
Let's play:
Assert.Xml.Exists(myXmlData, "<Root><Parent><Child><ThisElementShouldExist>");
Assert.Xml.Exists(myXmlData, "<Root><Parent><Child><Element
thisAttributeShouldExist>");
Assert.Xml.DoesNotExist(myXmlData,
"<Root><Parent><Child><ThisElementShouldNotExist>");
Assert.Xml.DoesNotExist(myXmlData, "<Root><Parent><Child><Element
thisAttributeShouldNotExist>");
Assert.Xml.AreEqual(myXmlData, "ExpectedValue",
"<Root><Parent><Child><Element>");
Assert.Xml.AreEqual(myXmlData, "ExpectedValue", "<Root><Parent><Child><Element
attribute>");
Assert.Xml.AreNotEqual(myXmlData, "UnexpectedValue",
"<Root><Parent><Child><Element>");
Assert.Xml.AreNotEqual(myXmlData, "UnexpectedValue",
"<Root><Parent><Child><Element
attribute>");
Assert.Xml.IsUnique(myXmlData,
"<Root><Parent><Child><ThisElementShouldBeUnique>");
etc.
I don't like too much this way to specify the location of an element (I just
type as
I think about it). We could perhaps have some kind of fluent syntax language:
Fragment.Element("Root").Element("Parent").Element("Child").Element("Element").A
ttrib
ute("thisAttributeShouldExist")
We probably also need some options for element value equality when the seached
element is not unique.
What do you think? Any suggestion?
Original comment by Yann.Tre...@gmail.com
on 18 Sep 2009 at 7:09
Assert.Xml.Exists complete
Basically, it verifies the existence of a given element or attribute in the XML
tree.
The next step is to extend that assertion so that it supports verifications
against a
value as well.
Original comment by Yann.Tre...@gmail.com
on 23 Sep 2009 at 9:34
Assert.Xml.Exists with item value checking is complete.
Next steps are:
- Assert.Xml.IsUnique
- Negative assertions (AreNotEqual, DoesNotExist, and IsNotUnique)
Original comment by Yann.Tre...@gmail.com
on 5 Oct 2009 at 9:30
Assert.Xml.IsUnique is done.
Mmh... I think it will be enough for now.
Let see what is going to happen, and push possible other XML related assertions
to
v3.3.
Original comment by Yann.Tre...@gmail.com
on 26 Oct 2009 at 7:14
Sounds good.
Could you write an article about this feature and maybe a blurb that I can
include in
the v3.2 release notes later?
Original comment by jeff.br...@gmail.com
on 26 Oct 2009 at 7:36
Yup.
Original comment by Yann.Tre...@gmail.com
on 26 Oct 2009 at 7:38
Original issue reported on code.google.com by
jeff.br...@gmail.com
on 21 Sep 2007 at 8:07