diff --git a/.dockerignore b/.dockerignore
index 932e9558..0acb2dd1 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -11,11 +11,9 @@ TestFixture.java
.idea/
target/*
.lein-repl-history
-example.rb
-/setup
-/examples
-/test
/pull.js
/server.js
/push.js
-/README.md
\ No newline at end of file
+/README.md
+node_modules/*
+docker/*
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index e21d53cd..8ceb1e85 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,4 @@ example.rb
Dockerfile
*.o
*.hi
+\#*
diff --git a/LICENSE b/LICENSE
index 7d889ea7..cf72b711 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,664 +1,21 @@
-Copyright (c) 2014 Codewars
-
-GNU AFFERO GENERAL PUBLIC LICENSE
- Version 3, 19 November 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU Affero General Public License is a free, copyleft license for
-software and other kinds of works, specifically designed to ensure
-cooperation with the community in the case of network server software.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-our General Public Licenses are intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- Developers that use our General Public Licenses protect your rights
-with two steps: (1) assert copyright on the software, and (2) offer
-you this License which gives you legal permission to copy, distribute
-and/or modify the software.
-
- A secondary benefit of defending all users' freedom is that
-improvements made in alternate versions of the program, if they
-receive widespread use, become available for other developers to
-incorporate. Many developers of free software are heartened and
-encouraged by the resulting cooperation. However, in the case of
-software used on network servers, this result may fail to come about.
-The GNU General Public License permits making a modified version and
-letting the public access it on a server without ever releasing its
-source code to the public.
-
- The GNU Affero General Public License is designed specifically to
-ensure that, in such cases, the modified source code becomes available
-to the community. It requires the operator of a network server to
-provide the source code of the modified version running there to the
-users of that server. Therefore, public use of a modified version, on
-a publicly accessible server, gives the public access to the source
-code of the modified version.
-
- An older license, called the Affero General Public License and
-published by Affero, was designed to accomplish similar goals. This is
-a different license, not a version of the Affero GPL, but Affero has
-released a new version of the Affero GPL which permits relicensing under
-this license.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU Affero General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
+The MIT License (MIT)
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Remote Network Interaction; Use with the GNU General Public License.
-
- Notwithstanding any other provision of this License, if you modify the
-Program, your modified version must prominently offer all users
-interacting with it remotely through a computer network (if your version
-supports such interaction) an opportunity to receive the Corresponding
-Source of your version by providing access to the Corresponding Source
-from a network server at no charge, through some standard or customary
-means of facilitating copying of software. This Corresponding Source
-shall include the Corresponding Source for any work covered by version 3
-of the GNU General Public License that is incorporated pursuant to the
-following paragraph.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the work with which it is combined will remain governed by version
-3 of the GNU General Public License.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU Affero General Public License from time to time. Such new versions
-will be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU Affero General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU Affero General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU Affero General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published
- by the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If your software can interact with users remotely through a computer
-network, you should also make sure that it provides a way for users to
-get its source. For example, if your program is a web application, its
-interface could display a "Source" link that leads users to an archive
-of the code. There are many ways you could offer source, and different
-solutions will be better for different programs; see section 13 for the
-specific requirements.
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU AGPL, see
-.
+Copyright (c) 2014 Codewars
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..b01e766b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,55 @@
+HOSTNAME=codewars
+# func was removed due to issues compiling haskell using the latest base image.
+# We need to fix that image before we can ever update that image/codebase again :(
+#CONTAINERS=dotnet func jvm node python ruby systems
+CONTAINERS=dotnet jvm node python ruby systems alt func erlang
+
+ALL_CONTAINERS=${CONTAINERS} base
+
+.PHONY: ${ALL_CONTAINERS} clean docker_rm docker_rmi
+
+all: ${CONTAINERS}
+
+base:
+ cp docker/$@.docker ./Dockerfile
+ docker build -t $(HOSTNAME)/$@-runner .
+
+${CONTAINERS}: base
+ cp docker/$@.docker ./Dockerfile
+ docker build -t $(HOSTNAME)/$@-runner .
+
+# Push docker containers to registry
+push_to_registry:
+ docker push $(HOSTNAME)/base-runner
+ echo $(patsubst %, $(HOSTNAME)/%-runner, $(CONTAINERS)) | xargs -n 1 docker push
+
+# Remove docker processes that have exited cleanly
+docker_rm_exited:
+ [ ! -n "$(shell docker ps -a | grep Exit | cut -d ' ' -f 1)" ] || echo $(shell docker ps -a | grep Exit | cut -d ' ' -f 1) | xargs -n 1 docker rm -f
+
+# Kill temporary built images might fail if not exited cleanly
+docker_rmi_temporary:
+ [ ! -n "$(shell docker images --no-trunc | grep none | sed -e 's/\s\s*/\t/g' | cut -f3)" ] || docker images --no-trunc | grep none | sed -e 's/\s\s*/\t/g' | cut -f3 | xargs -n 1 docker rmi -f
+
+# Kill all of the in-flight and exited docker containers
+docker_rm:
+ docker ps -q | xargs docker stop
+ [ ! -n "$(shell docker ps -a -q)" ] || echo $(shell docker ps -a -q) | xargs -n 1 docker rm -f
+
+# Kill all docker images
+docker_rmi: docker_rm
+ [ ! -n "$(shell docker images -q)" ] || docker images -q | xargs -n 1 docker rmi -f
+
+clean: docker_rm_exited docker_rmi_temporary
+ for i in $(shell for i in $(HOSTNAME)/base $(patsubst %, $(HOSTNAME)/%-runner, $(CONTAINERS)) ; do docker images | grep $$i | sed -e 's/\s\s*/\t/g' | cut -f1; done) ; do docker rmi -f $$i ; done
+
+deep-clean: docker_rmi
+
+pull:
+ docker pull codewars/ruby-runner
+ docker pull codewars/node-runner
+ docker pull codewars/python-runner
+ docker pull codewars/dotnet-runner
+ docker pull codewars/jvm-runner
+ docker pull codewars/systems-runner
+ docker pull codewars/func-runner
diff --git a/README.md b/README.md
index 19cb6f8b..d7f6f92d 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,75 @@
+# runner
-TODO: update documentation
+This project is both a command-line utility and server, used by [Codewars](http://www.codewars.com) to execute small sets of code within various languages, using various testing frameworks.
+
+You can run `node run --help` to view information about which arguments are supported.
+
+## Purpose
+
+The purpose of this project is to provide a low level ability to run 'Kata'. It provides a mechanism for executing different configurations of code using various languages and testing frameworks.
+
+Docker can be utilized in order to sandbox code execution. A server is provided that can accept 'run' requests and execute them within a Docker container.
+
+## Language Support Status
+
+Many languages are currently supported in various states of completeness. This list tries to keep track of each.
+
+**Legend:** `!!!` = Failing Specs, `???` = Status is unknown, `*` = Any
+
+| Language | solutionOnly | testSuite | Codewars | Strive | Docker Image | Examples | Notes |
+|--------------|--------------|----------------|--------------|----------------|----------------|--------------|-------------------------------------------------------------------------|
+| Bash | ✓ | | Kumite | | * | | |
+| C | ✓ | Failing | ? | | systems-runner | | |
+| Clojure | ✓ | clojure.test | clojure.test | clojure.test | func-runner | clojure.test | |
+| CoffeeScript | ✓ | cw-2, mocha | cw-2 | cw-2, mocha | node-runner | cw-2 | |
+| CPP | ✓ | | | | systems-runner | | |
+| C# | ✓ | nunit | nunit | nunit | dotnet-runner | nunit | |
+| Elixir | ✓ | | | | erlang-runner | | |
+| Erlang | ✓ | | | | erlang-runner | | |
+| F# | ✓ | | Kumite Only | | dotnet-runner | | |
+| Go | ✓ | | Kumite Only | | alt-runner | | |
+| Groovy | ✓ | | Kumite Only | | jvm-runner | | |
+| Haskell | ✓ | hspec!!! | hspec | hspec | func-runner | hspec | An older version is running on CW & Strive that is fully functional |
+| Java | ✓ | junit | Yes | Yes | jvm-runner | junit | |
+| JavaScript | ✓ | cw-2, mocha | cw-2 | cw-2, mocha | node-runner | cw-2 | |
+| Julia | ✓!!! | Failing | | | | | |
+| Lisp | ✓ | | Kumite Only | | func-runner | | |
+| Lua | ✓ | | Kumite Only | | alt-runner | | |
+| ObjC | ??? | ??? | | | | | |
+| OCAML | ✓ | | Kumite Only | | func-runner | | |
+| Perl | ✓ | | Kumite Only | | * | | |
+| Php | ✓ | | Kumite Only | | alt-runner | | |
+| Python 2 | ✓ | cw-2, unittest | cw-2 | cw-2, unittest | python-runner | cw-2 | |
+| Python 3 | ✓ | cw-2, unittest | | cw-2, unittest | python-runner | cw-2 | |
+| R | ✓ | | | | alt-runner | | |
+| Racket | ✓ | | Kumite Only | | func-runner | | |
+| Ruby | ✓ | cw-2, rspec | cw-2 | cw-2, rspec | ruby-runner | cw-2 | |
+| Rust | ✓ | | | | | | |
+| Scala | ✓ | | Kumite Only | | jvm-runner | | |
+| Swift | ??? | ??? | | | | | Current contribution designed for OSX, need to move to OS linux version |
+| TypeScript | ✓ | mocha | Kumite Only | | node-runner | | TypeScript utilizes `require` instead of concatenating files |
+
+
+## Setup
+
+You should have Docker installed, if not do that first. Before you can run any of the code
+environments you will need to build the proper Docker image. To get started lets work with the
+node image.
+
+Run `make base node` to build the base and node images. This will take a few minutes.
+
+Once you image is built, you can create a container to work within it. Doing this means you do not
+have to worry about having any of the project dependencies loaded directly on your machine.
+
+Run the following command:
+
+```
+docker run -it --rm --entrypoint bash -v $(pwd)/lib:/runner/lib -v $(pwd)/frameworks:/runner/frameworks -v $(pwd)/test:/runner/test codewars/node-runner
+```
+
+This will create a new container and send you into the instance with your project's lib and test directories mounted
+as volumes. Mounting as a volume allows you to change files on your local machine and have those changes available to you
+from within the container.
+
+> We do not mount the entire directory because that would overwrite things such as your node_modules directory. If you need
+to update these you should `make node` the image to ensure you are always testing against the correct packages.
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 00000000..495df6ce
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,19 @@
+version: '2'
+services:
+ base:
+ build:
+ context: .
+ dockerfile: base.docker
+ image: codewars/base-runner
+
+ ruby:
+ build:
+ context: .
+ dockerfile: ruby.docker
+ image: codewars/ruby-runner
+
+ node:
+ build:
+ context: .
+ dockerfile: node.docker
+ image: codewars/node-runner
\ No newline at end of file
diff --git a/docker/alt.docker b/docker/alt.docker
index 40aa1401..814cf439 100644
--- a/docker/alt.docker
+++ b/docker/alt.docker
@@ -1,32 +1,9 @@
-# BUILD-USING: docker build -t codewars/runner-julia .
-# TEST-USING: docker run --rm -i -t --name=test-runner-julia --entrypoint=/bin/bash codewars/runner-julia -s
-# RUN-USING: docker run --rm --name=runner-julia codewars/runner-julia --help
-
# Pull base image.
-FROM codewars/runner-base
-
-# Install Julia
-# Julia is really slow, but v0.3 is okay (see http://stackoverflow.com/a/20566032)
-# In the future, don't use nightly builds, use releases
-RUN add-apt-repository ppa:staticfloat/julianightlies
-RUN add-apt-repository ppa:staticfloat/julia-deps
-RUN apt-get update
-RUN apt-get -y install julia
-# Nightly builds have a noisy OpenBLAS error, workaround
-RUN mv /usr/bin/julia /usr/bin/julia-noisy
-RUN printf '#!/bin/bash\njulia-noisy "$@" 2> >(grep -v "OpenBLAS : Your OS does not support AVX instructions." 1>&2)' > /usr/bin/julia
-RUN chmod a+x /usr/bin/julia
-
-# Install erlang
-RUN echo "deb http://packages.erlang-solutions.com/ubuntu trusty contrib" >> /etc/apt/sources.list
-RUN curl http://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | apt-key add -
-RUN apt-get update
-RUN apt-get -y install erlang-nox erlang-dev
+FROM codewars/base-runner
# Install PHP
RUN apt-get -y install php-pear php5-dev libcurl3-openssl-dev
-
# Install GoLang
WORKDIR /tmp
# http://blog.labix.org/2013/06/15/in-flight-deb-packages-of-go
@@ -36,12 +13,6 @@ RUN ./godeb install 1.3.1
RUN rm godeb
#RUN apt-get install -y golang
-# Install Rust 0.11
-# Workaround since the author of this PPA is Scandanavian, with a unicode name, and the tools hate this
-RUN add-apt-repository "deb http://ppa.launchpad.net/hansjorg/rust/ubuntu trusty main"
-RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BD6B6386
-RUN apt-get update
-RUN apt-get -y install rust-0.11
# Install Lua
RUN apt-get install -y lua5.2
@@ -51,30 +22,13 @@ RUN apt-get install -y luarocks
#RUN apt-add-repository ppa:swi-prolog/stable && apt-get update
#RUN apt-get install -y swi-prolog
-# Install ZMQ
-#RUN luarocks install https://raw.github.com/Neopallium/lua-zmq/master/rockspecs/lua-zmq-scm-1.rockspec
-RUN pecl install zmq-beta #php
-RUN apt-get install -y libzeromq-perl #perl
-
-# Install Elixir
-# Elixir needs a UTF-8 locale
-RUN apt-get install -y locales && dpkg-reconfigure locales && locale-gen en_US.UTF-8
-WORKDIR /tmp
-RUN git clone https://github.com/elixir-lang/elixir.git
-WORKDIR /tmp/elixir
-RUN git checkout tags/v1.0.0
-RUN make install
-RUN rm -rf /tmp/elixir
-
-
-
# Install GNU R
RUN apt-get install -y r-base
# ADD cli-runner and install node deps
-ADD . /codewars
+ADD . /runner
-WORKDIR /codewars
+WORKDIR /runner
RUN npm install
# Run the test suite to make sure this thing works
@@ -83,10 +37,7 @@ USER codewarrior
# Set environment variables
ENV USER codewarrior
ENV HOME /home/codewarrior
-ENV LANG en_US.UTF-8
-ENV LANGUAGE en_US:en
-ENV LC_ALL en_US.UTF-8
-RUN mocha -t 5000 test/runners/{go,php,erlang,elixir,julia,rust,go,lua,perl,r}_spec.js
+RUN mocha -t 3000 test/runners/{php,go,r,lua}_spec.js
#timeout is a fallback in case an error with node
#prevents it from exiting properly
diff --git a/docker/base.docker b/docker/base.docker
index 8bca4a79..2ee5a167 100644
--- a/docker/base.docker
+++ b/docker/base.docker
@@ -3,7 +3,35 @@
# RUN-USING: docker run --rm --name=runner-base codewars/runner-base --help
# Pull base image.
-FROM dockerfile/ubuntu
+FROM buildpack-deps:trusty
+
+RUN apt-get update -qq
+
+# gpg keys listed at https://github.com/nodejs/node
+RUN set -ex \
+ && for key in \
+ 9554F04D7259F04124DE6B476D5A82AC7E37093B \
+ 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
+ 0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93 \
+ FD3A5288F042B6850C66B31F09FE44734EB7990E \
+ 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
+ DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
+ B9AE9905FFD7803F25714661B63B535A4C206CA9 \
+ C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
+ ; do \
+ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
+ done
+
+ENV NPM_CONFIG_LOGLEVEL info
+ENV NODE_VERSION 5.8.0
+
+# Install NodeJS
+RUN curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" \
+ && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
+ && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
+ && grep " node-v$NODE_VERSION-linux-x64.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
+ && tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 \
+ && rm "node-v$NODE_VERSION-linux-x64.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt
# Set the env variables to non-interactive
ENV DEBIAN_FRONTEND noninteractive
@@ -21,42 +49,28 @@ CMD ["bash"]
# Append any relevant run args as per the help
-RUN apt-get update
-
+ENV NODE_ENV production
ENTRYPOINT ["timeout", "15", "node"]
-# Install Node.js (needed to run actual runner)
-RUN add-apt-repository ppa:chris-lea/node.js
-RUN apt-get update
-RUN apt-get install -y nodejs
-RUN su codewarrior -c "echo '\n# Node.js\nexport PATH=\"/codewars/node_modules/.bin:$PATH\"' >> ~codewarrior/.bash_profile"
-
# Install Redis
RUN apt-get install -y redis-server
-# Install MongoDB
-RUN apt-get install -y mongodb-server && \
- mkdir -p /data/db && \
- chown codewarrior:codewarrior /data/db
-
# Install SQLITE
RUN apt-get install -y sqlite libsqlite3-dev
-# Install ElasticSearch
-RUN wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.deb && \
- dpkg -i elasticsearch-1.1.1.deb
+# Install MongoDB
+RUN apt-get install -y mongodb
-# Install RabitMQ
-RUN apt-get install -y rabbitmq-server
+RUN mkdir /.npm-global
+RUN npm config set prefix '/.npm-global'
+RUN su codewarrior -c "echo 'export PATH=\"/.npm-global/bin:$PATH\"' >> ~/.profile"
+ENV PATH /.npm-global/bin:$PATH
-# Install ZMQ
-RUN apt-get install -y libzmq3-dev
+# Install Node testing frameworks & additional frameworks
+RUN npm install -g chai mocha
# Install Python Basics
-RUN apt-get install -y python-software-properties
-
-# Install Node testing frameworks & additional frameworks
-RUN npm -g install chai mocha
+RUN apt-get install -y python-minimal
-# Install pkg-config for things that need to compile from source
-RUN apt-get install -y pkg-config
+# Install Git
+RUN apt-get -y install git
\ No newline at end of file
diff --git a/docker/dotnet.docker b/docker/dotnet.docker
index 8582a338..423075ef 100644
--- a/docker/dotnet.docker
+++ b/docker/dotnet.docker
@@ -3,7 +3,13 @@
# RUN-USING: docker run --rm --name=runner-dotnet codewars/runner-dotnet --help
# Pull base image.
-FROM codewars/runner-base
+FROM codewars/base-runner
+
+RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
+RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
+RUN echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list
+
+RUN apt-get update
# Install Mono
RUN apt-get install -y mono-complete
@@ -11,28 +17,10 @@ RUN apt-get install -y mono-complete
# Install F#
RUN apt-get install -y fsharp
-# Install NuGet
-RUN mkdir -p /usr/local/share/mono/
-WORKDIR /usr/local/share/mono/
-RUN mozroots --import --sync
-RUN wget 'http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=nuget&DownloadId=835802&FileTime=130438931143730000&Build=20928' -O NuGet.exe
-
-RUN mono NuGet.exe update -self
-RUN mono NuGet.exe install xunit ; \
- mono NuGet.exe install xunit.extensions ; \
- mono NuGet.exe install ; \
- mono NuGet.exe install log4net ; \
- mono NuGet.exe install mongocsharpdriver ; \
- mono NuGet.exe install System.Data.SQLite
-
-# this is currently breaking the build
-#RUN mono NuGet.exe install NUnit ; \
-# mono NuGet.exe install NUnit.Runners ; \
-
# ADD cli-runner and install node deps
-ADD . /codewars
+ADD . /runner
-WORKDIR /codewars
+WORKDIR /runner
RUN npm install
# Run the test suite to make sure this thing works
@@ -43,6 +31,7 @@ ENV USER codewarrior
ENV HOME /home/codewarrior
RUN mocha -t 10000 test/runners/{csharp,fsharp}_spec.js
+RUN mono -V
#timeout is a fallback in case an error with node
#prevents it from exiting properly
diff --git a/docker/erlang.docker b/docker/erlang.docker
new file mode 100644
index 00000000..8da02442
--- /dev/null
+++ b/docker/erlang.docker
@@ -0,0 +1,55 @@
+# Pull base image.
+FROM codewars/base-runner
+
+WORKDIR /tmp
+# Set the locale
+RUN locale-gen en_US.UTF-8
+ENV LANG en_US.UTF-8
+ENV LANGUAGE en_US:en
+ENV LC_ALL en_US.UTF-8
+
+RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
+
+RUN echo "deb http://packages.erlang-solutions.com/ubuntu trusty contrib" >> /etc/apt/sources.list && \
+ apt-key adv --fetch-keys http://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc && \
+ apt-get -qq update && apt-get install -y \
+ esl-erlang \
+ git \
+ unzip \
+ build-essential \
+ wget && \
+ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+
+# Download and Install Specific Version of Elixir
+WORKDIR /elixir
+RUN wget -q https://github.com/elixir-lang/elixir/releases/download/v1.2.4/Precompiled.zip && \
+ unzip Precompiled.zip && \
+ rm -f Precompiled.zip && \
+ ln -s /elixir/bin/elixirc /usr/local/bin/elixirc && \
+ ln -s /elixir/bin/elixir /usr/local/bin/elixir && \
+ ln -s /elixir/bin/mix /usr/local/bin/mix && \
+ ln -s /elixir/bin/iex /usr/local/bin/iex
+
+# Install local Elixir hex and rebar
+RUN /usr/local/bin/mix local.hex --force && \
+ /usr/local/bin/mix local.rebar --force
+
+WORKDIR /
+
+# ADD cli-runner and install node deps
+ADD . /runner
+
+WORKDIR /runner
+RUN npm install
+
+# Run the test suite to make sure this thing works
+
+USER codewarrior
+# Set environment variables
+ENV USER codewarrior
+ENV HOME /home/codewarrior
+RUN mocha -t 5000 test/runners/{erlang,elixir}_spec.js
+
+#timeout is a fallback in case an error with node
+#prevents it from exiting properly
+ENTRYPOINT ["timeout", "15", "node"]
diff --git a/docker/full.docker b/docker/full.docker
deleted file mode 100644
index 8459a396..00000000
--- a/docker/full.docker
+++ /dev/null
@@ -1,232 +0,0 @@
-# BUILD-USING: docker build -t codewars/cli-runner .
-# TEST-USING: docker run --rm -i -t --name=test-cli-runner --entrypoint=/bin/bash codewars/cli-runner -s
-# RUN-USING: docker run --rm --name=cli-runner codewars/cli-runner --help
-# EXAMPLE USAGE: docker run --rm codewars/cli-runner run -l ruby -c "puts 1+1"
-
-# Pull base image.
-FROM dockerfile/ubuntu
-
-# Set the env variables to non-interactive
-ENV DEBIAN_FRONTEND noninteractive
-ENV DEBIAN_PRIORITY critical
-ENV DEBCONF_NOWARNINGS yes
-ENV TERM linux
-RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
-
-# ADD codewarrior user
-RUN useradd codewarrior
-RUN rm -rf ~codewarrior && cp -a ~root ~codewarrior && chown -R codewarrior:codewarrior ~codewarrior
-RUN apt-get install -y python python-dev python-pip python-virtualenv
-
-# Define mountable directories.
-
-# Install Node.js
-RUN add-apt-repository ppa:chris-lea/node.js
-RUN apt-get update
-RUN apt-get install -y nodejs
-RUN su codewarrior -c "echo '\n# Node.js\nexport PATH=\"/codewars/node_modules/.bin:$PATH\"' >> ~codewarrior/.bash_profile"
-
-# Define default command.
-CMD ["bash"]
-
-# Append any relevant run args as per the help
-
-RUN apt-get update
-
-# Install Mono
-RUN apt-get install -y mono-csharp-shell --fix-missing
-
-# Install F#
-RUN apt-get install -y fsharp
-
-# Install Coffeescript
-RUN npm -g install coffee-script
-
-# Install Node testing frameworks & additional frameworks
-RUN npm -g install chai mocha immutable
-
-# Install Lua
-RUN apt-get install -y lua5.2
-
-# Install Python 3
-
-# Install Additional Python libraries
-RUN sudo apt-get install -y python-numpy python-scipy python-pandas
-
-# Install Java 8
-# RUN apt-get install -y default-jre-headless default-jdk # default is OpenJDK6
-RUN add-apt-repository ppa:webupd8team/java
-RUN apt-get update
-# http://askubuntu.com/a/190674
-RUN echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
- echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
-RUN apt-get install -y oracle-java8-installer
-
-# Install Clojure (well, install Leiningen)
-RUN curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > /usr/bin/lein
-RUN chmod a+x /usr/bin/lein
-
-# Install Haskell
-RUN apt-get install -y ghc cabal-install
-RUN su codewarrior -c "cabal update"
-RUN su codewarrior -c "cd ~codewarrior ; cabal install hspec"
-
-# Install Julia
-# Julia is really slow, but v0.3 is okay (see http://stackoverflow.com/a/20566032)
-# In the future, don't use nightly builds, use releases
-RUN add-apt-repository ppa:staticfloat/julianightlies
-RUN add-apt-repository ppa:staticfloat/julia-deps
-RUN apt-get update
-RUN apt-get -y install julia
-# Nightly builds have a noisy OpenBLAS error, workaround
-RUN mv /usr/bin/julia /usr/bin/julia-noisy
-RUN printf '#!/bin/bash\njulia-noisy "$@" 2> >(grep -v "OpenBLAS : Your OS does not support AVX instructions." 1>&2)' > /usr/bin/julia
-RUN chmod a+x /usr/bin/julia
-
-# Install erlang
-RUN echo "deb http://packages.erlang-solutions.com/ubuntu trusty contrib" >> /etc/apt/sources.list
-RUN curl http://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | apt-key add -
-RUN apt-get update
-RUN apt-get -y install erlang-nox erlang-dev
-
-# Install PHP
-RUN apt-get -y install php5-cli
-
-# Install GoLang
-WORKDIR /tmp
-# http://blog.labix.org/2013/06/15/in-flight-deb-packages-of-go
-# This was cool but then it stopped working... that sucks... ~Matt
-RUN curl https://godeb.s3.amazonaws.com/godeb-amd64.tar.gz | tar zxv
-RUN ./godeb install 1.3.1
-RUN rm godeb
-#RUN apt-get install -y golang
-
-# Install TypeScript
-RUN npm -g install typescript
-
-#Install ruby
-RUN apt-get install -y python-software-properties && \
- apt-add-repository -y ppa:brightbox/ruby-ng && \
- apt-get update && \
- apt-get install -y ruby2.1 ruby2.1-dev && \
- update-alternatives --remove ruby /usr/bin/ruby2.1 && \
- update-alternatives --remove irb /usr/bin/irb2.1 && \
- update-alternatives --remove gem /usr/bin/gem2.1 && \
- update-alternatives \
- --install /usr/bin/ruby ruby /usr/bin/ruby2.1 50 \
- --slave /usr/bin/irb irb /usr/bin/irb2.1 \
- --slave /usr/bin/rake rake /usr/bin/rake2.1 \
- --slave /usr/bin/gem gem /usr/bin/gem2.1 \
- --slave /usr/bin/rdoc rdoc /usr/bin/rdoc2.1 \
- --slave /usr/bin/testrb testrb /usr/bin/testrb2.1 \
- --slave /usr/bin/erb erb /usr/bin/erb2.1 \
- --slave /usr/bin/ri ri /usr/bin/ri2.1 && \
- update-alternatives --config ruby && \
- update-alternatives --display ruby
-
-## install bundler
-RUN gem install rspec --no-ri --no-rdoc
-RUN gem install rspec-its --no-ri --no-rdoc
-
-#RUN gem install minitest --no-ri --no-rdoc
-
-# Install additional gems
-RUN gem install rails --no-ri --no-rdoc
-
-# Install Racket
-RUN apt-get -y install racket
-
-# Install SBCL (Steel Bank Common Lisp)
-RUN apt-get -y install sbcl
-
-# Install Tiny C Compiler
-RUN apt-get -y install tcc
-
-# Install CLANG 3.4
-RUN add-apt-repository ppa:ubuntu-toolchain-r/ppa
-RUN apt-get update
-RUN apt-get -y install clang-3.4 lldb-3.4
-
-# Install OCAML
-RUN apt-get -y install ocaml-nox
-
-# Install Rust 0.11
-# Workaround since the author of this PPA is Scandanavian, with a unicode name, and the tools hate this
-RUN add-apt-repository "deb http://ppa.launchpad.net/hansjorg/rust/ubuntu trusty main"
-RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BD6B6386
-RUN apt-get update
-RUN apt-get -y install rust-0.11
-
-# Install SQLITE
-RUN apt-get install -y sqlite libsqlite3-dev
-RUN gem install sqlite3 --no-ri --no-rdoc
-RUN npm -g install sqlite3
-
-# Install MongoDB
-RUN apt-get install -y mongodb-server && \
- mkdir -p /data/db && \
- chown codewarrior:codewarrior /data/db
-
-# Install mongo packages for languages
-RUN npm -g install mongoose mongodb
-RUN pip install pymongo
-RUN gem install mongo --no-ri --no-rdoc
-RUN gem install mongoid --no-ri --no-rdoc
-
-# Install Redis
-RUN apt-get install -y redis-server
-
-# Install Redis Language packages
-RUN npm -g install redis
-RUN gem install redis --no-ri --no-rdoc
-RUN pip install redis
-
-# CUDA 6
-#RUN wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1204/x86_64/cuda-repo-ubuntu1204_6.0-37_amd64.deb && \
-# dpkg -i cuda-repo-ubuntu1204_6.0-37_amd64.deb && \
-# rm cuda-repo-ubuntu1204_6.0-37_amd64.deb
-#RUN apt-get update
-#RUN apt-get install -y cuda-core-6-0
-# Install GPUOcelot
-#RUN apt-get -y install subversion
-#RUN svn checkout http://gpuocelot.googlecode.com/svn/trunk/ gpuocelot-read-only
-#RUN apt-get -y install flex bison scons libboost-all-dev llvm llvm-dev freeglut3-dev libglew-dev
-#RUN cd gpuocelot-read-only && \
-# ./build.py --install
-
-# NASM
-RUN apt-get -y install nasm
-
-# ARM Assembly Emulation
-RUN apt-get -y install gcc-4.7-arm-linux-gnueabi libc6-dev-armel-cross qemu-user
-
-# Install Persistent Database support for Haskell
-RUN apt-get -y install libghc-zlib-dev && su codewarrior -c "cabal install esqueleto persistent-sqlite persistent-template"
-
-# Install Octave
-RUN apt-get -y install octave
-
-# Install pip3 and pymongo for Python3
-RUN apt-get -y install python3-pip && pip3 install pymongo
-
-# ADD cli-runner and install node deps
-ADD . /codewars
-
-# Build the jvm-runner
-WORKDIR /codewars/jvm-runner
-RUN [ -e target/jvm-runner-0.1.1-standalone.jar ] || LEIN_ROOT=true lein do clean, test, uberjar
-
-WORKDIR /codewars
-RUN npm install
-
-# Run the test suite to make sure this thing works
-
-USER codewarrior
-# Set environment variables
-ENV USER codewarrior
-ENV HOME /home/codewarrior
-RUN mocha -t 5000 test/*
-
-#timeout is a fallback in case an error with node
-#prevents it from exiting properly
-ENTRYPOINT ["timeout", "15", "node"]
diff --git a/docker/func.docker b/docker/func.docker
index cc21445f..29a7e416 100644
--- a/docker/func.docker
+++ b/docker/func.docker
@@ -3,7 +3,7 @@
# RUN-USING: docker run --rm --name=runner-func codewars/runner-func --help
# Pull base image.
-FROM codewars/runner-base
+FROM codewars/base-runner
# Install Racket
RUN apt-get -y install racket
@@ -14,32 +14,40 @@ RUN apt-get -y install sbcl
# Install OCAML
RUN apt-get -y install ocaml-nox
-# Install Haskell
-RUN apt-get install -y ghc cabal-install
-RUN su codewarrior -c "cabal update"
-RUN su codewarrior -c "cd ~codewarrior ; cabal install hspec"
-
-# Install Persistent Database support for Haskell
-RUN apt-get -y install libghc-zlib-dev
-
-WORKDIR /tmp
-RUN su codewarrior -c "cabal install esqueleto persistent-sqlite persistent-template"
+# Needed to run add-apt-repository
+RUN apt-get -y install software-properties-common
-# ZMQ
-RUN apt-get install -y pkg-config
-RUN su codewarrior -c "cabal install zeromq4-haskell"
-
-# Support hidding modules/built-ins
-RUN apt-get install -y happy
-RUN su codewarrior -c "cabal install haskell-src-exts"
-
-# Lens for haskell
-RUN su codewarrior -c "cabal install lens"
+# Install Haskell
+## ensure locale is set during build
+ENV LANG C.UTF-8
+
+RUN apt-get -y install libghc-zlib-dev happy
+
+RUN echo 'deb http://ppa.launchpad.net/hvr/ghc/ubuntu trusty main' > /etc/apt/sources.list.d/ghc.list && \
+ echo 'deb http://download.fpcomplete.com/debian/jessie stable main'| tee /etc/apt/sources.list.d/fpco.list && \
+ # hvr keys
+ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286 && \
+ # fpco keys
+ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C5705533DA4F78D8664B5DC0575159689BEFB442 && \
+ apt-get update && \
+ apt-get install -y --no-install-recommends cabal-install-1.22 ghc-7.10.3 happy-1.19.5 alex-3.1.4 \
+ stack zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev ca-certificates g++ && \
+ rm -rf /var/lib/apt/lists/*
+
+ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/cabal/1.22/bin:/opt/ghc/7.10.3/bin:/opt/happy/1.19.5/bin:/opt/alex/3.1.4/bin:$PATH
+
+# Install Haskell Packages
+RUN apt-get -y install libghc-zlib-dev pkg-config happy
+RUN cabal update
+RUN cabal install hspec
+RUN cabal install haskell-src-exts lens
+RUN cabal install esqueleto persistent-sqlite persistent-template
+RUN cabal install split ifelse
# ADD cli-runner and install node deps
-ADD . /codewars
+ADD . /runner
-WORKDIR /codewars
+WORKDIR /runner
RUN npm install
# Run the test suite to make sure this thing works
@@ -48,7 +56,7 @@ USER codewarrior
# Set environment variables
ENV USER codewarrior
ENV HOME /home/codewarrior
-RUN mocha -t 5000 test/runners/{haskell,ocaml,lisp,racket}_spec.js
+#RUN mocha -t 5000 test/runners/{haskell,ocaml,lisp,racket}_spec.js
#timeout is a fallback in case an error with node
#prevents it from exiting properly
diff --git a/docker/jvm.docker b/docker/jvm.docker
index b6bcaf0d..353d2dcd 100644
--- a/docker/jvm.docker
+++ b/docker/jvm.docker
@@ -3,7 +3,10 @@
# RUN-USING: docker run --rm --name=runner-jvm codewars/runner-jvm --help
# Pull base image.
-FROM codewars/runner-base
+FROM codewars/base-runner
+
+# Needed to run add-apt-repository
+RUN apt-get -y install software-properties-common
# Install Java 8
# RUN apt-get install -y default-jre-headless default-jdk # default is OpenJDK6
@@ -18,51 +21,20 @@ RUN apt-get install -y oracle-java8-installer
RUN curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > /usr/bin/lein
RUN chmod a+x /usr/bin/lein
RUN mkdir ~/.lein
-RUN echo '{:user {\
-:dependencies [\
- [org.clojure/clojure "1.6.0"] \
- [cheshire "5.3.1"] \
- [korma "0.3.0"] \
- [com.h2database/h2 "1.3.170"] \
- [org.xerial/sqlite-jdbc "3.7.15-M1"] \
- [com.novemberain/monger "2.0.0"] \
- [com.taoensso/carmine "2.7.0" :exclusions [org.clojure/clojure]] \
- [org.clojure/core.async "0.1.346.0-17112a-alpha"] \
- [org.clojure/test.check "0.5.9"] \
- [prismatic/schema "0.2.6"] \
- [instaparse "1.3.4"] \
- [org.clojure/core.logic "0.8.8"] \
- [org.clojure/core.match "0.2.1"] \
- [prismatic/plumbing "0.3.3"] \
- [slingshot "0.11.0"] \
- [compojure "1.1.9"] \
- [clj-http "1.0.0"] \
- [enlive "1.1.5"] \
- [hiccup "1.0.5"] \
- [junit/junit "4.11"] \
- [org.codehaus.groovy/groovy-all "2.3.6"] \
- [environ "0.5.0"] \
-] \
-:plugins [ \
- [lein-exec "0.3.4"] \
- [lein-environ "0.5.0"] \
-]}}' > ~/.lein/profiles.clj
-RUN LEIN_ROOT=true lein exec -e '(prn :ok)'
# Install scala
RUN apt-get install -y scala
RUN curl http://downloads.typesafe.com/scala/2.11.2/scala-2.11.2.deb > /tmp/scala-2.11.2.deb
RUN dpkg -i /tmp/scala-2.11.2.deb && rm /tmp/scala-2.11.2.deb
-
# ADD cli-runner and install node deps
-ADD . /codewars
+ADD . /runner
# Build the jvm-runner
-WORKDIR /codewars/jvm-runner
+WORKDIR /runner/jvm-runner
RUN LEIN_ROOT=true lein do clean, test, uberjar
-WORKDIR /codewars
+WORKDIR /runner
RUN npm install
# Run the test suite to make sure this thing works
diff --git a/docker/node.docker b/docker/node.docker
index 3b6c1dd9..2b3d7752 100644
--- a/docker/node.docker
+++ b/docker/node.docker
@@ -1,13 +1,36 @@
-# BUILD-USING: docker build -t codewars/runner-node .
-# TEST-USING: docker run --rm -i -t --name=test-runner-node --entrypoint=/bin/bash codewars/runner-node -s
-# RUN-USING: docker run --rm --name=runner-node codewars/runner-node --help
-# EXAMPLE USAGE: docker run --rm codewars/runner-node run -l javascript -c "console.log(1+1)"
+# RUN-USING: docker run --rm --name=node codewars/node-runner --help
+# EXAMPLE USAGE: docker run --rm codewars/node-runner run -l javascript -c "console.log(1+1)"
# Pull base image.
-FROM codewars/runner-base
+FROM codewars/base-runner
-# Install Haxe
-RUN apt-get install -y haxe
+# Install additional libraries
+# HACK: installing globallying and then linking has a less buggy experience.
+# NOTE: we dont configure these via package.json in order to prevent having to re-install them on each code change
+RUN npm link chai
+RUN npm install immutable -gq; npm link immutable
+RUN npm install deku -gq; npm link deku
+RUN npm install quickcheck -gq; npm link quickcheck
+RUN npm install should -gq; npm link should
+RUN npm install expect -gq; npm link expect
+RUN npm install chai-spies -gq; npm link chai-spies
+RUN npm install chai-stats -gq; npm link chai-stats
+RUN npm install chai-factories -gq; npm link chai-factories
+RUN npm install chai-things -gq; npm link chai-things
+RUN npm install chai-fuzzy -gq; npm link chai-fuzzy
+RUN npm install chai-interface -gq; npm link chai-interface
+RUN npm install chai-change -gq; npm link chai-change
+RUN npm install chai-subset -gq; npm link chai-subset
+RUN npm install rx -gq; npm link rx
+RUN npm install baconjs -gq; npm link baconjs
+RUN npm install lodash -gq; npm link lodash
+RUN npm install react -gq; npm link react
+RUN npm install react-dom -gq; npm link react-dom
+RUN npm install mongoose -gq; npm link mongoose
+RUN npm install mongodb -gq; npm link mongodb
+RUN npm install redis -gq; npm link redis
+RUN npm install sqlite3 -gq; npm link sqlite3
+RUN npm install elasticsearch -gq; npm link elasticsearch
# Install Coffeescript
RUN npm -g install coffee-script
@@ -15,28 +38,36 @@ RUN npm -g install coffee-script
# Install TypeScript
RUN npm -g install typescript
-RUN npm -g install chai mocha
+# install TypeScript type definitions
+RUN npm install -gq typings; npm link typings
-RUN npm -g install mongoose mongodb
-RUN npm -g install redis
-RUN npm -g install sqlite3
-RUN npm -g install elasticsearch
-RUN npm -g install zmq
-RUN npm -g install immutable
+RUN typings install node --ambient
+RUN typings install mocha --ambient
+RUN typings install mocha-node --ambient
+RUN typings install chai --ambient
+RUN typings install react --ambient
+RUN typings install lodash --ambient
+RUN typings install baconjs --ambient
+RUN typings install rx --ambient
+RUN typings install mongoose --ambient
+RUN typings install redis --ambient
# ADD cli-runner and install node deps
-ADD . /codewars
+ADD . /runner
-WORKDIR /codewars
+WORKDIR /runner
RUN npm install
+RUN npm install --only=dev
+RUN npm dedupe # needed to fix slow babeljs performance
+ENV NODE_PATH /usr/lib/node_modules
-# Run the test suite to make sure this thing works
-
-USER codewarrior
# Set environment variables
+USER codewarrior
ENV USER codewarrior
ENV HOME /home/codewarrior
-RUN mocha -t 5000 test/runners/javascript_spec.js test/runners/coffeescript_spec.js test/runners/typescript_spec.js
+
+# Run the test suite to make sure this thing works
+#RUN mocha -t 5000 test/runners/{javascript,coffeescript,typescript}_spec.js
#timeout is a fallback in case an error with node
#prevents it from exiting properly
diff --git a/docker/python.docker b/docker/python.docker
index de9a78f9..6352a37b 100644
--- a/docker/python.docker
+++ b/docker/python.docker
@@ -1,26 +1,23 @@
-# BUILD-USING: docker build -t codewars/runner-python .
-# TEST-USING: docker run --rm -i -t --name=test-runner-python --entrypoint=/bin/bash codewars/runner-python -s
-# RUN-USING: docker run --rm --name=runner-python codewars/runner-python --help
-# EXAMPLE USAGE: docker run --rm codewars/runner-python run -l python -c "print 1+1 "
-# docker run --rm codewars/runner-python run -l python3 -c "print(1+1)"
+# EXAMPLE USAGE: docker run --rm codewars/python-runner run -l python -c "print 1+1 "
+# docker run --rm codewars/python-runner run -l python3 -c "print(1+1)"
# Pull base image.
-FROM codewars/runner-base
+FROM codewars/base-runner
# Install Additional Python libraries
-RUN sudo apt-get install -y python-pip python-numpy python-scipy python-pandas
+RUN apt-get install -y python-pip python-numpy python-scipy python-pandas
# Install Python 3
-RUN sudo apt-get install -y python3-pip python3-numpy python3-scipy python3-pandas
+RUN apt-get install -y python3-pip python3-numpy python3-scipy python3-pandas
# Install Packages
-RUN pip install pymongo redis pyzmq
-RUN pip3 install pymongo redis pyzmq
+RUN pip install pymongo redis
+RUN pip3 install pymongo redis
# ADD cli-runner and install node deps
-ADD . /codewars
+ADD . /runner
-WORKDIR /codewars
+WORKDIR /runner
RUN npm install
# Run the test suite to make sure this thing works
diff --git a/docker/ruby.docker b/docker/ruby.docker
index 6b4fe3ec..4ebc5c62 100644
--- a/docker/ruby.docker
+++ b/docker/ruby.docker
@@ -4,32 +4,68 @@
# EXAMPLE USAGE: docker run --rm codewars/runner-ruby run -l ruby -c "puts 1+1"
# Pull base image.
-FROM codewars/runner-base
+FROM codewars/base-runner
#Install ruby
-RUN apt-add-repository -y ppa:brightbox/ruby-ng && \
- apt-get update && \
- apt-get install -y ruby2.1 ruby2.1-dev && \
- update-alternatives --remove ruby /usr/bin/ruby2.1 && \
- update-alternatives --remove irb /usr/bin/irb2.1 && \
- update-alternatives --remove gem /usr/bin/gem2.1 && \
- update-alternatives \
- --install /usr/bin/ruby ruby /usr/bin/ruby2.1 50 \
- --slave /usr/bin/irb irb /usr/bin/irb2.1 \
- --slave /usr/bin/rake rake /usr/bin/rake2.1 \
- --slave /usr/bin/gem gem /usr/bin/gem2.1 \
- --slave /usr/bin/rdoc rdoc /usr/bin/rdoc2.1 \
- --slave /usr/bin/testrb testrb /usr/bin/testrb2.1 \
- --slave /usr/bin/erb erb /usr/bin/erb2.1 \
- --slave /usr/bin/ri ri /usr/bin/ri2.1 && \
- update-alternatives --config ruby && \
- update-alternatives --display ruby
-
-## install Rspec
+# skip installing gem documentation
+RUN mkdir -p /usr/local/etc \
+ && { \
+ echo 'install: --no-document'; \
+ echo 'update: --no-document'; \
+ } >> /usr/local/etc/gemrc
+
+ENV RUBY_MAJOR 2.3
+ENV RUBY_VERSION 2.3.0
+ENV RUBY_DOWNLOAD_SHA256 ba5ba60e5f1aa21b4ef8e9bf35b9ddb57286cb546aac4b5a28c71f459467e507
+ENV RUBYGEMS_VERSION 2.6.1
+
+# some of ruby's build scripts are written in ruby
+# we purge this later to make sure our final image uses what we just built
+RUN set -ex \
+ && buildDeps=' \
+ bison \
+ libgdbm-dev \
+ ruby \
+ ' \
+ && apt-get update \
+ && apt-get install -y --no-install-recommends $buildDeps \
+ && rm -rf /var/lib/apt/lists/* \
+ && curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
+ && echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
+ && mkdir -p /usr/src/ruby \
+ && tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
+ && rm ruby.tar.gz \
+ && cd /usr/src/ruby \
+ && { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \
+ && autoconf \
+ && ./configure --disable-install-doc \
+ && make -j"$(nproc)" \
+ && make install \
+ && apt-get purge -y --auto-remove $buildDeps \
+ && gem update --system $RUBYGEMS_VERSION \
+ && rm -r /usr/src/ruby
+
+ENV BUNDLER_VERSION 1.11.2
+
+RUN gem install bundler --version "$BUNDLER_VERSION"
+
+# install things globally, for great justice
+# and don't create ".bundle" in all our apps
+ENV GEM_HOME /usr/local/bundle
+ENV BUNDLE_PATH="$GEM_HOME" \
+ BUNDLE_BIN="$GEM_HOME/bin" \
+ BUNDLE_SILENCE_ROOT_WARNING=1 \
+ BUNDLE_APP_CONFIG="$GEM_HOME"
+ENV PATH $BUNDLE_BIN:$PATH
+RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
+ && chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
+
+# Ruby Gems
RUN gem install rspec --no-ri --no-rdoc
RUN gem install rspec-its --no-ri --no-rdoc
-#RUN gem install minitest --no-ri --no-rdoc
+# needed for nokogiri
+RUN apt-get -y install zlib1g-dev
# Install additional gems
RUN gem install pry --no-ri --no-rdoc
@@ -54,15 +90,37 @@ RUN gem install googlecharts --no-ri --no-rdoc
RUN gem install ffi-rzmq --no-ri --no-rdoc
RUN gem install bunny --no-ri --no-rdoc
RUN gem install amqp --no-ri --no-rdoc
-RUN gem install functional-ruby --no-ri --no-rdoc
RUN gem install concurrent-ruby --no-ri --no-rdoc
-#RUN gem install gruff --no-ri --no-rdoc
-#RUN gem install chartkick --no-ri --no-rdoc
+RUN gem install sciruby --no-ri --no-rdoc
+# reduced selection of sciruby-full gems since all needed build dependencies are not installed
+RUN gem install ai4r --no-ri --no-rdoc
+RUN gem install algorithms --no-ri --no-rdoc
+RUN gem install awesome_print --no-ri --no-rdoc
+RUN gem install classifier --no-ri --no-rdoc
+RUN gem install daru --no-ri --no-rdoc
+RUN gem install darwinning --no-ri --no-rdoc
+RUN gem install decisiontree --no-ri --no-rdoc
+RUN gem install distribution --no-ri --no-rdoc
+RUN gem install gga4r --no-ri --no-rdoc
+RUN gem install gimuby --no-ri --no-rdoc
+RUN gem install hamster --no-ri --no-rdoc
+RUN gem install histogram --no-ri --no-rdoc
+RUN gem install measurable --no-ri --no-rdoc
+RUN gem install mikon --no-ri --no-rdoc
+RUN gem install minimization --no-ri --no-rdoc
+RUN gem install narray --no-ri --no-rdoc
+RUN gem install ruby-fann --no-ri --no-rdoc
+RUN gem install statsample --no-ri --no-rdoc
+RUN gem install statsample-glm --no-ri --no-rdoc
+RUN gem install statsample-timeseries --no-ri --no-rdoc
+RUN gem install stuff-classifier --no-ri --no-rdoc
+RUN gem install symbolic --no-ri --no-rdoc
+RUN gem install unit --no-ri --no-rdoc
# ADD cli-runner and install node deps
-ADD . /codewars
+ADD . /runner
-WORKDIR /codewars
+WORKDIR /runner
RUN npm install
# Run the test suite to make sure this thing works
diff --git a/docker/systems.docker b/docker/systems.docker
index 24809ae0..735c3412 100644
--- a/docker/systems.docker
+++ b/docker/systems.docker
@@ -4,11 +4,14 @@
# Pull base image.
-FROM codewars/runner-base
+FROM codewars/base-runner
# Install Tiny C Compiler
RUN apt-get -y install tcc
+# Needed to run add-apt-repository
+RUN apt-get -y install software-properties-common
+
# Install CLANG 3.4
RUN add-apt-repository ppa:ubuntu-toolchain-r/ppa
RUN apt-get update
@@ -21,9 +24,9 @@ RUN apt-get -y install nasm
RUN apt-get -y install gcc-4.7-arm-linux-gnueabi libc6-dev-armel-cross qemu-user
# ADD cli-runner and install node deps
-ADD . /codewars
+ADD . /runner
-WORKDIR /codewars
+WORKDIR /runner
RUN npm install
# Run the test suite to make sure this thing works
@@ -32,12 +35,7 @@ USER codewarrior
# Set environment variables
ENV USER codewarrior
ENV HOME /home/codewarrior
-RUN mocha -t 5000 test/runners/c_spec.js \
- test/runners/cpp_spec.js \
- test/runners/bash_spec.js \
- test/runners/arm_spec.js \
- test/runners/gas_spec.js \
- test/runners/nasm_spec.js
+RUN mocha -t 5000 test/runners/{gas,nasm,arm,cpp}_spec.js
#timeout is a fallback in case an error with node
#prevents it from exiting properly
diff --git a/examples/clojure.yml b/examples/clojure.yml
new file mode 100644
index 00000000..d25f04f0
--- /dev/null
+++ b/examples/clojure.yml
@@ -0,0 +1,32 @@
+'clojure.test':
+ reference:
+ initial: |-
+ (ns oldest)
+ (defn two-oldest-ages
+ "Returns the two oldest ages"
+ ;; TODO: Program me
+ )
+
+ answer: |-
+ (ns oldest)
+ (defn two-oldest-ages
+ "Returns the two oldest ages"
+ [ages]
+ (->> ages
+ sort
+ reverse
+ (take 2)
+ reverse))
+
+ fixture: |-
+ (ns oldest-test
+ (:require [clojure.test :refer :all]
+ [oldest :refer [two-oldest-ages]]))
+
+ (deftest basic-test
+ (let [input1 [1 5 87 45 8 8]
+ input2 [6 5 83 5 3 18]]
+ (testing (str "input1: " input1)
+ (is (= (two-oldest-ages input1) [45 87])))
+ (testing (str "input2: " input2)
+ (is (= (two-oldest-ages input2) [18 83])))))
\ No newline at end of file
diff --git a/examples/coffeescript.yml b/examples/coffeescript.yml
new file mode 100644
index 00000000..1c91740b
--- /dev/null
+++ b/examples/coffeescript.yml
@@ -0,0 +1,90 @@
+cw-2:
+ algorithms:
+ initial: |-
+ # return the two oldest/oldest ages within the array of ages passed in.
+ # it should return the two ages as a sorted array, youngest age first
+ twoOldestAges = (ages) ->
+
+ answer: |-
+ twoOldestAges = (ages) ->
+ oldest = 0
+ nextOldest = 0;
+ for age in ages
+ if age > oldest
+ nextOldest = oldest
+ oldest = age
+ else if age > nextOldest
+ nextOldest = age
+ [nextOldest, oldest]
+
+ fixture: |-
+ Test.describe "twoOldestAges([1,5,87,45,8,8])", ->
+ results1 = twoOldestAges [1,5,87,45,8,8]
+ Test.it "Should return something that isn't falsy", ->
+ Test.expect results1, "Something is wrong, twoOldestAges([1,5,87,45,8,8]) has no results!"
+ Test.it "Should return [45,87]", ->
+ Test.assertEquals results1[0], 45, "twoOldestAges([1,5,87,45,8,8]) should return 45 as the second highest result"
+ Test.assertEquals results1[1], 87, "twoOldestAges([1,5,87,45,8,8]) should return 87 as the second highest result"
+
+ Test.describe "twoOldestAges([6,5,83,5,3,18])", ->
+ results2 = twoOldestAges [6,5,83,5,3,18]
+ Test.assertSimilar results2, [18, 83]
+
+ bug fixes:
+ initial: |-
+ class Person
+ constructor: (@name) ->
+
+ #TODO: The greet function is not returning the expected value.
+ greet: -> "Hello my name is #{name}"
+
+ answer: |-
+ class Person
+ constructor: (@name) ->
+
+ greet: -> "Hello my name is #{@name}"
+
+ fixture: |-
+ jack = new Person "Jack"
+ jill = new Person "Jill"
+
+ Test.expect jack.name == "Jack", "person.name property does have have a valid value"
+
+ Test.expect jack.greet() == "Hello my name is Jack"
+ Test.expect jill.greet() == "Hello my name is Jill"
+
+ refactoring:
+ initial: |-
+ # TODO: This method needs to be called multiple times for the same person (myName).
+ # It would be nice if we didnt have to always pass in myName every time we needed to great someone.
+
+ greet = (myName, yourName) -> "Hello #{yourName}, my name is #{myName}"
+
+ answer: |-
+ class Person
+ constructor: (@name) ->
+
+ greet: (yourName) ->
+ "Hello #{yourName}, my name is #{@name}"
+
+ fixture: |-
+ jack = new Person "Jack"
+ jill = new Person "Jill"
+
+ Test.expect jack.greet("Jill") == "Hello Jill, my name is Jack"
+ Test.expect jack.greet("Mary") == "Hello Mary, my name is Jack"
+
+ Test.expect jill.greet("Jack") == "Hello Jack, my name is Jill"
+
+ reference:
+ initial: |-
+ websites = []
+
+ answer: |-
+ # add the values "codewars" to the websites array
+ websites = ["codewars"]
+
+ fixture: |-
+ Test.expect(websites.length > 0, 'The array is still empty')
+ Test.expect(websites.length == 1, 'The array contains too many values')
+ Test.expect(websites[0] == 'codewars', 'The array does not contain the correct value "codewars"')
diff --git a/examples/csharp.yml b/examples/csharp.yml
new file mode 100644
index 00000000..e178284c
--- /dev/null
+++ b/examples/csharp.yml
@@ -0,0 +1,80 @@
+nunit:
+ algorithms:
+ initial: |-
+ namespace Bank {
+ using System;
+ public class Account
+ {
+ private decimal balance;
+ public void Deposit(decimal amount)
+ {
+ }
+
+ public void Withdraw(decimal amount)
+ {
+ }
+
+ public void TransferFunds(Account destination, decimal amount)
+ {
+ }
+
+ public decimal Balance { get { return balance; } }
+ }
+ }
+
+ answer: |-
+ namespace Bank {
+ using System;
+ public class Account
+ {
+ private decimal balance;
+ public void Deposit(decimal amount)
+ {
+ balance += amount;
+ }
+
+ public void Withdraw(decimal amount)
+ {
+ balance -= amount;
+ }
+
+ public void TransferFunds(Account destination, decimal amount)
+ {
+ destination.Deposit(amount);
+ this.Withdraw(amount);
+ }
+
+ public decimal Balance { get { return balance; } }
+ }
+ }
+
+ fixture: |-
+ namespace Bank {
+ using NUnit.Framework;
+ using System;
+ [TestFixture]
+ public class AccountTest
+ {
+ [Test]
+ public void TransferFunds()
+ {
+ Account source = new Account();
+ source.Deposit(200m);
+ Account destination = new Account();
+ destination.Deposit(150m);
+ source.TransferFunds(destination, 100m);
+ Assert.AreEqual(250m, destination.Balance);
+ Assert.AreEqual(100m, source.Balance);
+ }
+
+ [Test]
+ public void CheckFunds()
+ {
+ Account source = new Account();
+ source.Deposit(200m);
+ Account destination = new Account();
+ destination.Deposit(150m);
+ Assert.AreEqual(200m, source.Balance);
+ }
+ }
+ }
\ No newline at end of file
diff --git a/examples/haskell.yml b/examples/haskell.yml
new file mode 100644
index 00000000..f1989408
--- /dev/null
+++ b/examples/haskell.yml
@@ -0,0 +1,48 @@
+hspec:
+ reference:
+ initial: |-
+ module Oldest where
+
+ -- | Return the two oldest/oldest ages within the array of ages passed in.
+ -- it should return the two ages as a sorted array, youngest age first
+ twoOldestAges :: [Integer] -> (Integer,Integer)
+ -- TODO: Write me
+
+ answer: |-
+ module Oldest where
+ import Data.List (sort)
+
+ -- | Return the two oldest/oldest ages within the array of ages passed in.
+ -- it should return the two ages as a sorted array, youngest age first
+ twoOldestAges :: [Integer] -> (Integer,Integer)
+ twoOldestAges ages =
+ let [b,a] = take 2 $ reverse $ sort $ ages
+ in (a,b)
+
+ fixture: |-
+ module Oldest.Test where
+ import Oldest
+ import Test.Hspec
+ import Text.Printf
+
+ -- Codewars wraps HSpec: http://hspec.github.io/
+ main = hspec $ do
+ -- hspec lets you test your code in blocks, like RSpec
+ describe "twoOldestAges" $ do
+ -- hspec supports nested describe blocks
+ describe (show input1) $ do
+ -- Individual tests are specified with 'it'
+ it (printf "should return %s given %s as input" (show expected1) (show input1))
+ $ do
+ let (a,b) = twoOldestAges input1
+ -- You can test multiple things in an individual test if you want
+ a `shouldBe` fst expected1
+ b `shouldBe` snd expected1
+ describe (show input2) $ do
+ it (printf "should return %s given %s as input" (show expected2) (show input2))
+ $ do twoOldestAges input2 `shouldBe` expected2
+ where
+ input1 = [1,5,87,45,8,8]
+ expected1 = (45,87)
+ input2 = [6,5,83,5,3,18]
+ expected2 = (18,83)
\ No newline at end of file
diff --git a/examples/java.yml b/examples/java.yml
new file mode 100644
index 00000000..8d21e363
--- /dev/null
+++ b/examples/java.yml
@@ -0,0 +1,42 @@
+junit:
+ reference:
+ initial: |-
+ public class Person {
+ String name;
+
+ public Person(String personName) {
+ // TODO: Program Constructor
+ }
+
+ public String greet(String yourName) {
+ // TODO: Write a greeting string
+ }
+ }
+
+ answer: |-
+ public class Person {
+ String name;
+
+ public Person(String personName) {
+ name = personName;
+ }
+
+ public String greet(String yourName) {
+ return String.format("Konbanwa! My name is %s. It is nice to meet you, %s!", this.name, yourName);
+ }
+ }
+
+ fixture: |-
+ import org.junit.Test;
+ import static org.junit.Assert.assertEquals;
+ import org.junit.runners.JUnit4;
+
+
+ public class PersonTest {
+ @Test
+ public void testGreet() {
+ Person shoki = new Person("Shoki, the Demon Queller");
+ assertEquals("Konbanwa! My name is Shoki, the Demon Queller. It is nice to meet you, Sun Wukong, the Monkey King!",
+ shoki.greet("Sun Wukong, the Monkey King"));
+ }
+ }
\ No newline at end of file
diff --git a/examples/javascript.yml b/examples/javascript.yml
new file mode 100644
index 00000000..44301488
--- /dev/null
+++ b/examples/javascript.yml
@@ -0,0 +1,102 @@
+cw-2:
+ algorithms:
+ initial: |-
+ // return the two oldest/oldest ages within the array of ages passed in.
+ // it should return the two ages as a sorted array, youngest age first
+ function twoOldestAges(ages){
+
+ }
+
+ answer: |-
+ function twoOldestAges(ages){
+ var oldest = 0, nextOldest;
+ for(var i = 0;i < ages.length;i++){
+ var age = ages[i];
+ if (age > oldest){
+ nextOldest = oldest;
+ oldest = age;
+ }
+ else if(age > nextOldest){
+ nextOldest = age;
+ }
+ }
+ return [nextOldest, oldest];
+ }
+
+ fixture: |-
+ Test.describe("twoOldestAges([1,5,87,45,8,8])", function() {
+ var results1 = twoOldestAges([1, 5, 87, 45, 8, 8]);
+ Test.it("Should return something that isn't falsy", function() {
+ Test.expect(results1, "Something is wrong, twoOldestAges([1,5,87,45,8,8]) has no results!");
+ });
+ Test.it("Should return [45,87]", function() {
+ Test.assertEquals(results1[0], 45, "twoOldestAges([1,5,87,45,8,8]) should return 45 as the second highest result");
+ Test.assertEquals(results1[1], 87, "twoOldestAges([1,5,87,45,8,8]) should return 87 as the second highest result");
+ });
+ });
+
+ Test.describe("twoOldestAges([6,5,83,5,3,18])", function() {
+ var results2 = twoOldestAges([6, 5, 83, 5, 3, 18]);
+ Test.assertSimilar(results2, [18, 83]);
+ });
+
+ bug fixes:
+ initial: |-
+ function Person(name){
+ this.name = name
+ }
+
+ //TODO: The greet function is not returning the expected value.
+ Person.prototype.greet = function(){
+ return "Hello my name is " + name
+ }
+
+ answer: |-
+ function Person(name){
+ this.name = name
+ }
+
+ Person.prototype.greet = function(){
+ return "Hello my name is " + this.name;
+ }
+
+ fixture: |-
+ var jack = new Person("Jack");
+ var jill = new Person("Jill");
+
+ Test.expect(jack.name == "Jack", "person.name does not have a valid value");
+
+ Test.expect(jack.greet, "greet method does not exist on the Person instance");
+ Test.expect(jack.greet() === "Hello my name is Jack");
+ Test.expect(jill.greet() === "Hello my name is Jill");
+
+ refactoring:
+ initial: |-
+ // TODO: This method needs to be called multiple times for the same person (myName).
+ // It would be nice if we didnt have to always pass in myName every time we needed to great someone.
+
+ function greet(myName, yourName){
+ return "Hello " + yourName + ", my name is " + myName;
+ }
+
+ answer: |-
+ function Person(name){
+ this.name = name
+ }
+
+ Person.prototype.greet = function(yourName){
+ return "Hello " + yourName + ", my name is " + this.name
+ }
+
+ reference:
+ initial: |-
+ var websites = [];
+
+ answer: |-
+ // add the values "codewars" to the websites array
+ var websites = ['codewars'];
+
+ fixture: |-
+ Test.expect(websites.length > 0, 'The array is still empty')
+ Test.expect(websites.length == 1, 'The array contains too many values')
+ Test.expect(websites[0] == 'codewars', 'The array does not contain the correct value "codewars"')
\ No newline at end of file
diff --git a/examples/javascript/cw-v2/fixture.js b/examples/javascript/cw-v2/fixture.js
deleted file mode 100644
index 6f8be35e..00000000
--- a/examples/javascript/cw-v2/fixture.js
+++ /dev/null
@@ -1 +0,0 @@
-Test.expect(a == 1);
\ No newline at end of file
diff --git a/examples/javascript/cw-v2/project.js b/examples/javascript/cw-v2/project.js
deleted file mode 100644
index ec1d07a4..00000000
--- a/examples/javascript/cw-v2/project.js
+++ /dev/null
@@ -1,12 +0,0 @@
-var __fs = require( 'fs' ), __vm = require('vm');
-function __include(path) {
- var code = __fs.readFileSync(path, 'utf-8');
- __vm.runInThisContext(code, path);
-}
-require('../../../frameworks/javascript/cw-js-v2');
-
-__include('./solution');
-(function() {
- __include('./fixture');
-})();
-
diff --git a/examples/javascript/cw-v2/solution.js b/examples/javascript/cw-v2/solution.js
deleted file mode 100644
index 8359463d..00000000
--- a/examples/javascript/cw-v2/solution.js
+++ /dev/null
@@ -1 +0,0 @@
-a = 1;
\ No newline at end of file
diff --git a/examples/python.yml b/examples/python.yml
new file mode 100644
index 00000000..0287ecc2
--- /dev/null
+++ b/examples/python.yml
@@ -0,0 +1,135 @@
+cw-2:
+ algorithms:
+ initial: |-
+ # return the two oldest/oldest ages within the array of ages passed in.
+ # it should return the two ages as a sorted array, youngest age first
+ def two_oldest_ages(ages):
+ # TODO: complete
+
+ answer: |-
+ def two_oldest_ages(ages):
+ oldest = 0
+ next_oldest = 0;
+ for age in ages:
+ if age > oldest:
+ next_oldest = oldest
+ oldest = age
+ elif age > next_oldest:
+ next_oldest = age
+
+ return [next_oldest, oldest]
+
+ fixture: |-
+ # some example data
+ results1 = two_oldest_ages([1,5,87,45,8,8])
+ results2 = two_oldest_ages([6,5,83,5,3,18])
+
+ # NOTE: You can use Test or test, whichever you prefer.
+
+ # Use "describe" to label your test suite.
+ Test.describe("two_oldest_ages:")
+
+ # Use "it" to identify the conditions you are testing for
+ Test.it("should return the second oldest age first")
+ # using assert_equals will report the invalid values to the user
+ Test.assert_equals(results1[0], 45)
+ # using expect will just give a user a generic error message, unless you provide a message
+ Test.expect(results2[0] == 18, "Number is not the second oldest")
+
+ # its best practice to test for multiple groups of tests, using it calls.
+ Test.it("should return the oldest age last")
+
+ Test.assert_equals(results1[1], 87)
+ Test.expect(results2[1] == 83, "Number is not the oldest")
+
+ bug fixes:
+ initial: |-
+ def add(a, b):
+ a + b
+
+ answer: |-
+ def add(a, b):
+ return a + b
+
+ fixture: |-
+ # Use "describe" to define the test suite
+ test.describe('add method')
+
+ # Use "it" to indicate a condition you are testing for
+ test.it('should add both arguments and return')
+
+ # "assert_equals" will return information about what values were
+ # expect if the assertion fails. This can be very useful to other
+ # users trying to pass the kata.
+ test.assert_equals(add(1,2), 3)
+
+ # "expect" is a lower level assertion that will allow you to test
+ # anything. It just needs a boolean result. You should pass a message
+ # as the second parameter so that if the assertion fails the user
+ # will be giving some useful information.
+ test.expect(add(1,1) == 2, "add(1,1) should == 2")
+
+ refactoring:
+ initial: |-
+ # refactor this method into a Person class with its own greet method
+ def greet(you, me):
+ return "Hello {0}, my name is {1}".format(you, me)
+
+ answer: |-
+ class Person:
+ def __init__(self, name):
+ self.name = name
+
+ def greet(self, name):
+ return "Hello {0}, my name is {1}".format(name, self.name)
+
+ fixture: |-
+ # Use "describe" to define the test suite
+ test.describe('Person')
+
+ jack = Person('Jack')
+
+ # Use "it" to indicate a condition you are testing for
+ test.it('should have a name')
+
+ # "assert_equals" will return information about what values were
+ # expect if the assertion fails. This can be very useful to other
+ # users trying to pass the kata.
+ test.assert_equals(jack.name, "Jack")
+
+
+ test.it("should greet Jill")
+
+ test.assert_equals(jack.greet("Jill"), "Hello Jill, my name is Jack")
+
+ test.it("should greet other people as well")
+
+ # unlike "assert_equals", "expect" is a lower level assertion that
+ # takes a boolean to determine if it passes. If it fails it will
+ # output the message that you give it, or a generic one. It is a good
+ # idea to provide a custom error message to help users pass the kata
+ test.expect(jack.greet("Jane") == "Hello Jane, my name is Jack", "Jack apparently is only able to greet Jane")
+
+ reference:
+ initial: |-
+ # create an array called websites that has "codewars" as its only value
+
+ answer: |-
+ websites = ['codewars']
+
+ fixture: |-
+ # Use test.describe (or Test.describe) to describe your test suite
+ test.describe("websites")
+
+ # Use "it" calls to describe the specific test case
+ test.it("should have the value 'codewars' inside of it")
+
+ # assert equals will pass if both items equal each other (using ==). If
+ # the test fails, assert_equals will output a descriptive message indicating
+ # what the values were expected to be.
+ test.assert_equals(['codewars'], websites)
+
+ # you can also use the lower level test.expect. If you use test.expect directly then
+ # you should provide a custom error message, as the default one will be pretty useless
+ # to users trying to pass the kata.
+ test.expect(['codewars'] == websites, 'Array does not have correct value')
\ No newline at end of file
diff --git a/examples/python3.yml b/examples/python3.yml
new file mode 100644
index 00000000..02392cbb
--- /dev/null
+++ b/examples/python3.yml
@@ -0,0 +1,134 @@
+cw-2:
+ algorithms:
+ initial: |-
+ # return the two oldest/oldest ages within the array of ages passed in.
+ # it should return the two ages as a sorted array, youngest age first
+ def two_oldest_ages(ages):
+ # TODO: complete
+
+ answer: |-
+ def two_oldest_ages(ages):
+ oldest = 0
+ next_oldest = 0;
+ for age in ages:
+ if age > oldest:
+ next_oldest = oldest
+ oldest = age
+ elif age > next_oldest:
+ next_oldest = age
+
+ return [next_oldest, oldest]
+
+ fixture: |-
+ # some example data
+ results1 = two_oldest_ages([1,5,87,45,8,8])
+ results2 = two_oldest_ages([6,5,83,5,3,18])
+
+ # NOTE: You can use Test or test, whichever you prefer.
+
+ # Use "describe" to label your test suite.
+ Test.describe("two_oldest_ages:")
+
+ # Use "it" to identify the conditions you are testing for
+ Test.it("should return the second oldest age first")
+ # using assert_equals will report the invalid values to the user
+ Test.assert_equals(results1[0], 45)
+ # using expect will just give a user a generic error message, unless you provide a message
+ Test.expect(results2[0] == 18, "Number is not the second oldest")
+
+ # its best practice to test for multiple groups of tests, using it calls.
+ Test.it("should return the oldest age last")
+
+ Test.assert_equals(results1[1], 87)
+ Test.expect(results2[1] == 83, "Number is not the oldest")
+
+ bug fixes:
+ initial: |-
+ def add(a, b):
+ a + b
+
+ answer: |-
+ def add(a, b):
+ return a + b
+
+ fixture: |-
+ # Use "describe" to define the test suite
+ test.describe('add method')
+
+ # Use "it" to indicate a condition you are testing for
+ test.it('should add both arguments and return')
+
+ # "assert_equals" will return information about what values were
+ # expect if the assertion fails. This can be very useful to other
+ # users trying to pass the kata.
+ test.assert_equals(add(1,2), 3)
+
+ # "expect" is a lower level assertion that will allow you to test
+ # anything. It just needs a boolean result. You should pass a message
+ # as the second parameter so that if the assertion fails the user
+ # will be giving some useful information.
+ test.expect(add(1,1) == 2, "add(1,1) should == 2")
+
+ refactoring:
+ initial: |-
+ # refactor this method into a Person class with its own greet method
+ def greet(you, me):
+ return "Hello {0}, my name is {1}".format(you, me)
+
+ answer: |-
+ class Person:
+ def __init__(self, name):
+ self.name = name
+
+ def greet(self, name):
+ return "Hello {0}, my name is {1}".format(name, self.name)
+
+ fixture: |-
+ # Use "describe" to define the test suite
+ test.describe('Person')
+
+ jack = Person('Jack')
+
+ # Use "it" to indicate a condition you are testing for
+ test.it('should have a name')
+
+ # "assert_equals" will return information about what values were
+ # expect if the assertion fails. This can be very useful to other
+ # users trying to pass the kata.
+ test.assert_equals(jack.name, "Jack")
+
+ test.it("should greet Jill")
+
+ test.assert_equals(jack.greet("Jill"), "Hello Jill, my name is Jack")
+
+ test.it("should greet other people as well")
+
+ # unlike "assert_equals", "expect" is a lower level assertion that
+ # takes a boolean to determine if it passes. If it fails it will
+ # output the message that you give it, or a generic one. It is a good
+ # idea to provide a custom error message to help users pass the kata
+ test.expect(jack.greet("Jane") == "Hello Jane, my name is Jack", "Jack apparently is only able to greet Jane")
+
+ reference:
+ initial: |-
+ # create an array called websites that has "codewars" as its only value
+
+ answer: |-
+ websites = ['codewars']
+
+ fixture: |-
+ # Use test.describe (or Test.describe) to describe your test suite
+ test.describe("websites")
+
+ # Use "it" calls to describe the specific test case
+ test.it("should have the value 'codewars' inside of it")
+
+ # assert equals will pass if both items equal each other (using ==). If
+ # the test fails, assert_equals will output a descriptive message indicating
+ # what the values were expected to be.
+ test.assert_equals(['codewars'], websites)
+
+ # you can also use the lower level test.expect. If you use test.expect directly then
+ # you should provide a custom error message, as the default one will be pretty useless
+ # to users trying to pass the kata.
+ test.expect(['codewars'] == websites, 'Array does not have correct value')
\ No newline at end of file
diff --git a/examples/ruby.yml b/examples/ruby.yml
new file mode 100644
index 00000000..e25c437a
--- /dev/null
+++ b/examples/ruby.yml
@@ -0,0 +1,107 @@
+cw-2:
+ bug fixes:
+ initial: |-
+ class Person
+ attr_reader :name
+ def initialize(name)
+ name = name
+ end
+
+ def greet
+ "Hello my name is #{name}"
+ end
+ end
+ answer: |-
+ class Person
+ attr_reader :name
+ def initialize(name)
+ @name = name
+ end
+
+ def greet
+ "Hello my name is #{name}"
+ end
+ end
+
+ fixture: |-
+ jack = Person.new("Jack")
+ jill = Person.new("Jill")
+
+ Test.expect(jack.name == "Jack", "person.name method does not have a valid value")
+
+ Test.expect(jack.greet == "Hello my name is Jack")
+ Test.expect(jill.greet == "Hello my name is Jill")
+
+ algorithms:
+ initial: |-
+ # return the two oldest/oldest ages within the array of ages passed in.
+ # it should return the two ages as a sorted array, youngest age first
+ def two_oldest_ages(ages)
+ end
+
+ answer: |-
+ def two_oldest_ages(ages)
+ oldest = 0
+ next_oldest = 0;
+ ages.each do |age|
+ if age > oldest
+ next_oldest = oldest
+ oldest = age
+ elsif age > next_oldest
+ next_oldest = age
+ end
+ end
+ [next_oldest, oldest]
+
+
+ fixture: |-
+ results1 = two_oldest_ages [1,5,87,45,8,8]
+ results2 = two_oldest_ages [6,5,83,5,3,18]
+
+ Test.expect(results1[0] == 45)
+ Test.expect(results1[1] == 87)
+
+ Test.expect(results2[0] == 18)
+ Test.expect(results2[1] == 83)
+
+ refactoring:
+ initial: |-
+ # TODO: This method needs to be called multiple times for the same person (myName).
+ # It would be nice if we didnt have to always pass in myName every time we needed to great someone.
+
+ def greet(myName, yourName)
+ "Hello #{yourName}, my name is #{myName}"
+ end
+
+ answer: |-
+ class Person
+ def initialize(name)
+ @name = name
+ end
+
+ def greet(yourName)
+ "Hello #{yourName}, my name is #{@name}"
+ end
+ end
+
+ fixture: |-
+ jack = Person.new("Jack")
+ jill = Person.new("Jill")
+
+ Test.expect(jack.greet("Jill") == "Hello Jill, my name is Jack")
+ Test.expect(jack.greet("Mary") == "Hello Mary, my name is Jack")
+
+ Test.expect(jill.greet("Jack") == "Hello Jack, my name is Jill")
+
+ reference:
+ initial: |-
+ websites = []
+
+ answer: |-
+ # add the values "codewars" to the websites array
+ websites << 'codewars'
+
+ fixture: |-
+ Test.expect(websites.length > 0, 'The array is still empty')
+ Test.expect(websites.length == 1, 'The array contains too many values')
+ Test.expect(websites[0] == 'codewars', 'The array does not contain the correct value "codewars"')
\ No newline at end of file
diff --git a/examples/ruby/fixture.rb b/examples/ruby/fixture.rb
deleted file mode 100644
index b83ac90c..00000000
--- a/examples/ruby/fixture.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require './solution'
-
-describe Example do
- it 'should work' do
- 1.should == 1
- end
-end
\ No newline at end of file
diff --git a/examples/ruby/solution.rb b/examples/ruby/solution.rb
deleted file mode 100644
index 58df36a1..00000000
--- a/examples/ruby/solution.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-class Example
-
-end
\ No newline at end of file
diff --git a/frameworks/c/test.c b/frameworks/c/test.c
deleted file mode 100644
index 9915918d..00000000
--- a/frameworks/c/test.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#include
-#include
-#include
-
-#define MAX_CHARS 1024
-
-char * format(const char * format_string, ...) {
- //! Create a new string, up to MAX_CHARS long
- //! Uses vsnprintf to format it, and returns it
- //! Users are responsible for freeing outputted string
- char * output_string = malloc(MAX_CHARS);
- va_list arguments;
- va_start(arguments, format_string);
- vsnprintf(output_string, MAX_CHARS, format_string, arguments);
- va_end(arguments);
- return output_string;
-}
-
-char * __CODEWARS__default_string__
-(char * default_string, ...) {
- //! Defaults to a particular value
- //! when no optional second argument is passed
- //! arguments must be terminted with NULL
- //! NOTE: this is intended for use in macros only!
- va_list arguments;
- char * second_argument;
- va_start(arguments, default_string);
- second_argument = va_arg(arguments, char*);
- va_end(arguments);
- return second_argument ? second_argument : default_string;
-}
-
-int __CODEWARS__stdout__(const char * first, ...) {
- //! Writes several strings to stdout
- //! Arguments must be terminated with NULL
- //! Returns the number of strings written
- char * arg;
- int i = 0;
- va_list arguments;
- fputs(first, stdout);
- va_start(arguments, first);
- while((arg = va_arg(arguments, char*))) {
- fputs(arg, stdout);
- ++i;
- }
- va_end(arguments);
- return i;
-}
-
-void __CODEWARS__fail__(const char * message) {
- //! Prints an error message and exits with failure status
- __CODEWARS__stdout__("", message, "\n", NULL);
- exit(EXIT_FAILURE);
-}
diff --git a/frameworks/c/test.h b/frameworks/c/test.h
deleted file mode 100644
index c07a4f13..00000000
--- a/frameworks/c/test.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef _CODEWARS_TEST_H_
-#define _CODEWARS_TEST_H_
-
-int __CODEWARS__stdout__(const char * first, ...);
-char * __CODEWARS__default_string__(char * default_string, ...);
-int __CODEWARS__fail__(const char * message);
-char * format(const char * format_string, ...);
-
-#define DESCRIBE(x) \
- __CODEWARS__stdout__("", (x), "<:LF:>\n", 0);
-
-#define IT(x) \
- __CODEWARS__stdout__("", (x), "<:LF:>\n", 0);
-
-#define EXPECT(fact, message...) \
- if((fact)) __CODEWARS__stdout__("Test Passed\n",0); \
- else __CODEWARS__fail__(__CODEWARS__default_string__("Value is not what was expected", ##message, 0));
-
-#define EXPECT_ERROR(fact, message...) \
- if(!(fact)) __CODEWARS__stdout__("Test Passed\n",0); \
- else __CODEWARS__fail__(__CODEWARS__default_string__("Value is not what was expected", ##message, 0));
-
-#define ASSERT_EQUALS(value1, value2, message...) \
- if((value1) == (value2)) __CODEWARS__stdout__("Test Passed\n",0); \
- else __CODEWARS__fail__(__CODEWARS__default_string__("Values are not equal", ##message, 0));
-
-#define ASSERT_NOT_EQUALS(value1, value2, message...) \
- if((value1) == (value2)) __CODEWARS__stdout__("Test Passed\n",0); \
- else __CODEWARS__fail__(__CODEWARS__default_string__("Values should not equal", ##message, 0));
-
-#endif _CODEWARS_TEST_H_
diff --git a/frameworks/csharp/nunit/agent.conf b/frameworks/csharp/nunit/agent.conf
new file mode 100644
index 00000000..b4cf5509
--- /dev/null
+++ b/frameworks/csharp/nunit/agent.conf
@@ -0,0 +1,4 @@
+
+ 8080
+ .
+
\ No newline at end of file
diff --git a/frameworks/csharp/nunit/agent.log.conf b/frameworks/csharp/nunit/agent.log.conf
new file mode 100644
index 00000000..6a9ced8b
--- /dev/null
+++ b/frameworks/csharp/nunit/agent.log.conf
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frameworks/csharp/nunit/framework/framework/nunit.framework.dll b/frameworks/csharp/nunit/framework/framework/nunit.framework.dll
new file mode 100755
index 00000000..956c32c2
Binary files /dev/null and b/frameworks/csharp/nunit/framework/framework/nunit.framework.dll differ
diff --git a/frameworks/csharp/nunit/framework/framework/nunit.framework.xml b/frameworks/csharp/nunit/framework/framework/nunit.framework.xml
new file mode 100644
index 00000000..bec89757
--- /dev/null
+++ b/frameworks/csharp/nunit/framework/framework/nunit.framework.xml
@@ -0,0 +1,9329 @@
+
+
+
+ nunit.framework
+
+
+
+
+ Delegate used by tests that execute code and
+ capture any thrown exception.
+
+
+
+ The Assert class contains a collection of static methods that
+ implement the most common assertions used in NUnit.
+
+
+
+ We don't actually want any instances of this object, but some people
+ like to inherit from it to add other static methods. Hence, the
+ protected constructor disallows any instances of this object.
+
+
+
+ Gets the number of assertions executed so far and
+ resets the counter to zero.
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+ Helper for Assert.AreEqual(double expected, double actual, ...)
+ allowing code generation to work consistently.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Throws a with the message and arguments
+ that are passed in. This allows a test to be cut short, with a result
+ of success returned to NUnit.
+
+ The message to initialize the with.
+ Arguments to be used in formatting the message
+
+
+ Throws a with the message and arguments
+ that are passed in. This allows a test to be cut short, with a result
+ of success returned to NUnit.
+
+ The message to initialize the with.
+
+
+ Throws a with the message and arguments
+ that are passed in. This allows a test to be cut short, with a result
+ of success returned to NUnit.
+
+
+
+ Throws an with the message and arguments
+ that are passed in. This is used by the other Assert functions.
+
+ The message to initialize the with.
+ Arguments to be used in formatting the message
+
+
+ Throws an with the message that is
+ passed in. This is used by the other Assert functions.
+
+ The message to initialize the with.
+
+
+ Throws an .
+ This is used by the other Assert functions.
+
+
+
+ Throws an with the message and arguments
+ that are passed in. This causes the test to be reported as ignored.
+
+ The message to initialize the with.
+ Arguments to be used in formatting the message
+
+
+ Throws an with the message that is
+ passed in. This causes the test to be reported as ignored.
+
+ The message to initialize the with.
+
+
+ Throws an .
+ This causes the test to be reported as ignored.
+
+
+
+ Throws an with the message and arguments
+ that are passed in. This causes the test to be reported as inconclusive.
+
+ The message to initialize the with.
+ Arguments to be used in formatting the message
+
+
+ Throws an with the message that is
+ passed in. This causes the test to be reported as inconclusive.
+
+ The message to initialize the with.
+
+
+ Throws an .
+ This causes the test to be reported as Inconclusive.
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint to be applied
+ The actual value to test
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint to be applied
+ The actual value to test
+ The message that will be displayed on failure
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint expression to be applied
+ An ActualValueDelegate returning the value to be tested
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint expression to be applied
+ An ActualValueDelegate returning the value to be tested
+ The message that will be displayed on failure
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ An ActualValueDelegate returning the value to be tested
+ A Constraint expression to be applied
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint to be applied
+ The actual value to test
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint to be applied
+ The actual value to test
+ The message that will be displayed on failure
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint to be applied
+ The actual value to test
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display if the condition is false
+ Arguments to be used in formatting the message
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display if the condition is false
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+
+
+ Asserts that the code represented by a delegate throws an exception
+ that satisfies the constraint provided.
+
+ A TestDelegate to be executed
+ A ThrowsConstraint used in the test
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+ Used as a synonym for That in rare cases where a private setter
+ causes a Visual Basic compilation error.
+
+ A Constraint to be applied
+ The actual value to test
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+ Used as a synonym for That in rare cases where a private setter
+ causes a Visual Basic compilation error.
+
+ A Constraint to be applied
+ The actual value to test
+ The message that will be displayed on failure
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+ Used as a synonym for That in rare cases where a private setter
+ causes a Visual Basic compilation error.
+
+
+ This method is provided for use by VB developers needing to test
+ the value of properties with private setters.
+
+ A Constraint expression to be applied
+ The actual value to test
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ A constraint to be satisfied by the exception
+ A TestSnippet delegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ A constraint to be satisfied by the exception
+ A TestSnippet delegate
+ The message that will be displayed on failure
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ A constraint to be satisfied by the exception
+ A TestSnippet delegate
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ The exception Type expected
+ A TestSnippet delegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ The exception Type expected
+ A TestSnippet delegate
+ The message that will be displayed on failure
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ The exception Type expected
+ A TestSnippet delegate
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ Type of the expected exception
+ A TestSnippet delegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ Type of the expected exception
+ A TestSnippet delegate
+ The message that will be displayed on failure
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ Type of the expected exception
+ A TestSnippet delegate
+
+
+ Verifies that a delegate throws an exception when called
+ and returns it.
+
+ A TestDelegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Verifies that a delegate throws an exception when called
+ and returns it.
+
+ A TestDelegate
+ The message that will be displayed on failure
+
+
+ Verifies that a delegate throws an exception when called
+ and returns it.
+
+ A TestDelegate
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+ The message that will be displayed on failure
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+ The message that will be displayed on failure
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+
+
+ Verifies that a delegate does not throw an exception
+
+ A TestSnippet delegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Verifies that a delegate does not throw an exception.
+
+ A TestSnippet delegate
+ The message that will be displayed on failure
+
+
+ Verifies that a delegate does not throw an exception.
+
+ A TestSnippet delegate
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null
then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null
then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null
then an
+ is thrown.
+
+ The object that is to be tested
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null
then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null
then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null
then an
+ is thrown.
+
+ The object that is to be tested
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null
then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null
then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null
then an
+ is thrown.
+
+ The object that is to be tested
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null
then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null
then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null
then an
+ is thrown.
+
+ The object that is to be tested
+
+
+ Verifies that the double that is passed in is an NaN
value.
+ If the object is not NaN
then an
+ is thrown.
+
+ The value that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the double that is passed in is an NaN
value.
+ If the object is not NaN
then an
+ is thrown.
+
+ The value that is to be tested
+ The message to display in case of failure
+
+
+ Verifies that the double that is passed in is an NaN
value.
+ If the object is not NaN
then an
+ is thrown.
+
+ The value that is to be tested
+
+
+ Verifies that the double that is passed in is an NaN
value.
+ If the object is not NaN
then an
+ is thrown.
+
+ The value that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the double that is passed in is an NaN
value.
+ If the object is not NaN
then an
+ is thrown.
+
+ The value that is to be tested
+ The message to display in case of failure
+
+
+ Verifies that the double that is passed in is an NaN
value.
+ If the object is not NaN
then an
+ is thrown.
+
+ The value that is to be tested
+
+
+ Assert that a string is empty - that is equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Assert that a string is empty - that is equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+
+
+ Assert that a string is empty - that is equal to string.Empty
+
+ The string to be tested
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing ICollection
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing ICollection
+ The message to display in case of failure
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing ICollection
+
+
+ Assert that a string is not empty - that is not equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Assert that a string is not empty - that is not equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+
+
+ Assert that a string is not empty - that is not equal to string.Empty
+
+ The string to be tested
+
+
+ Assert that an array, list or other collection is not empty
+
+ An array, list or other collection implementing ICollection
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Assert that an array, list or other collection is not empty
+
+ An array, list or other collection implementing ICollection
+ The message to display in case of failure
+
+
+ Assert that an array, list or other collection is not empty
+
+ An array, list or other collection implementing ICollection
+
+
+ Assert that a string is either null or equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Assert that a string is either null or equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+
+
+ Assert that a string is either null or equal to string.Empty
+
+ The string to be tested
+
+
+ Assert that a string is not null or empty
+
+ The string to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Assert that a string is not null or empty
+
+ The string to be tested
+ The message to display in case of failure
+
+
+ Assert that a string is not null or empty
+
+ The string to be tested
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+ The message to display in case of failure
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+ The message to display in case of failure
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+
+
+ Verifies that two objects are equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are not equal an is thrown.
+
+ The value that is expected
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two objects are equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are not equal an is thrown.
+
+ The value that is expected
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two objects are equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are not equal an is thrown.
+
+ The value that is expected
+ The actual value
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two objects are not equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are equal an is thrown.
+
+ The value that is expected
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two objects are not equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are equal an is thrown.
+
+ The value that is expected
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two objects are not equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are equal an is thrown.
+
+ The value that is expected
+ The actual value
+
+
+ Asserts that two objects refer to the same object. If they
+ are not the same an is thrown.
+
+ The expected object
+ The actual object
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that two objects refer to the same object. If they
+ are not the same an is thrown.
+
+ The expected object
+ The actual object
+ The message to display in case of failure
+
+
+ Asserts that two objects refer to the same object. If they
+ are not the same an is thrown.
+
+ The expected object
+ The actual object
+
+
+ Asserts that two objects do not refer to the same object. If they
+ are the same an is thrown.
+
+ The expected object
+ The actual object
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that two objects do not refer to the same object. If they
+ are the same an is thrown.
+
+ The expected object
+ The actual object
+ The message to display in case of failure
+
+
+ Asserts that two objects do not refer to the same object. If they
+ are the same an is thrown.
+
+ The expected object
+ The actual object
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Asserts that an object is contained in a list.
+
+ The expected object
+ The list to be examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object is contained in a list.
+
+ The expected object
+ The list to be examined
+ The message to display in case of failure
+
+
+ Asserts that an object is contained in a list.
+
+ The expected object
+ The list to be examined
+
+
+ AssertionHelper is an optional base class for user tests,
+ allowing the use of shorter names for constraints and
+ asserts and avoiding conflict with the definition of
+ , from which it inherits much of its
+ behavior, in certain mock object frameworks.
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure. Works
+ identically to Assert.That
+
+ A Constraint to be applied
+ The actual value to test
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure. Works
+ identically to Assert.That.
+
+ A Constraint to be applied
+ The actual value to test
+ The message that will be displayed on failure
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure. Works
+ identically to Assert.That
+
+ A Constraint to be applied
+ The actual value to test
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint expression to be applied
+ An ActualValueDelegate returning the value to be tested
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint expression to be applied
+ An ActualValueDelegate returning the value to be tested
+ The message that will be displayed on failure
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ An ActualValueDelegate returning the value to be tested
+ A Constraint expression to be applied
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint to be applied
+ The actual value to test
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint to be applied
+ The actual value to test
+ The message that will be displayed on failure
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint to be applied
+ The actual value to test
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an . Works Identically to Assert.That.
+
+ The evaluated condition
+ The message to display if the condition is false
+ Arguments to be used in formatting the message
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an . Works Identically to Assert.That.
+
+ The evaluated condition
+ The message to display if the condition is false
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an . Works Identically Assert.That.
+
+ The evaluated condition
+
+
+ Asserts that the code represented by a delegate throws an exception
+ that satisfies the constraint provided.
+
+ A TestDelegate to be executed
+ A ThrowsConstraint used in the test
+
+
+ Returns a ListMapper based on a collection.
+
+ The original collection
+
+
+
+ Provides static methods to express the assumptions
+ that must be met for a test to give a meaningful
+ result. If an assumption is not met, the test
+ should produce an inconclusive result.
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+ The message that will be displayed on failure
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ An ActualValueDelegate returning the value to be tested
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ An ActualValueDelegate returning the value to be tested
+ The message that will be displayed on failure
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ An ActualValueDelegate returning the value to be tested
+ A Constraint expression to be applied
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+ The message that will be displayed on failure
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display if the condition is false
+ Arguments to be used in formatting the message
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display if the condition is false
+
+
+ Asserts that a condition is true. If the condition is false the
+ method throws an .
+
+ The evaluated condition
+
+
+ Asserts that the code represented by a delegate throws an exception
+ that satisfies the constraint provided.
+
+ A TestDelegate to be executed
+ A ThrowsConstraint used in the test
+
+
+ The different targets a test action attribute can be applied to
+
+
+
+ Default target, which is determined by where the action attribute is attached
+
+
+
+ Target a individual test case
+
+
+
+ Target a suite of test cases
+
+
+
+ Attribute used to apply a category to a test
+
+
+
+ The name of the category
+
+
+
+ Construct attribute for a given category based on
+ a name. The name may not contain the characters ',',
+ '+', '-' or '!'. However, this is not checked in the
+ constructor since it would cause an error to arise at
+ as the test was loaded without giving a clear indication
+ of where the problem is located. The error is handled
+ in NUnitFramework.cs by marking the test as not
+ runnable.
+
+ The name of the category
+
+
+ Protected constructor uses the Type name as the name
+ of the category.
+
+
+
+ The name of the category
+
+
+
+ Used to mark a field for use as a datapoint when executing a theory
+ within the same fixture that requires an argument of the field's Type.
+
+
+
+ Used to mark an array as containing a set of datapoints to be used
+ executing a theory within the same fixture that requires an argument
+ of the Type of the array elements.
+
+
+
+ Attribute used to provide descriptive text about a
+ test case or fixture.
+
+
+
+ Construct the attribute
+
+ Text describing the test
+
+
+ Gets the test description
+
+
+
+ Enumeration indicating how the expected message parameter is to be used
+
+
+ Expect an exact match
+
+ Expect a message containing the parameter string
+
+ Match the regular expression provided as a parameter
+
+ Expect a message that starts with the parameter string
+
+
+ ExpectedExceptionAttribute
+
+
+
+ Constructor for a non-specific exception
+
+
+
+ Constructor for a given type of exception
+
+ The type of the expected exception
+
+
+ Constructor for a given exception name
+
+ The full name of the expected exception
+
+
+ Gets or sets the expected exception type
+
+
+
+ Gets or sets the full Type name of the expected exception
+
+
+
+ Gets or sets the expected message text
+
+
+
+ Gets or sets the user message displayed in case of failure
+
+
+
+ Gets or sets the type of match to be performed on the expected message
+
+
+
+ Gets the name of a method to be used as an exception handler
+
+
+
+ ExplicitAttribute marks a test or test fixture so that it will
+ only be run if explicitly executed from the gui or command line
+ or if it is included by use of a filter. The test will not be
+ run simply because an enclosing suite is run.
+
+
+
+ Default constructor
+
+
+
+ Constructor with a reason
+
+ The reason test is marked explicit
+
+
+ The reason test is marked explicit
+
+
+
+ Attribute used to mark a test that is to be ignored.
+ Ignored tests result in a warning message when the
+ tests are run.
+
+
+
+ Constructs the attribute without giving a reason
+ for ignoring the test.
+
+
+
+ Constructs the attribute giving a reason for ignoring the test
+
+ The reason for ignoring the test
+
+
+ The reason for ignoring a test
+
+
+
+ Abstract base for Attributes that are used to include tests
+ in the test run based on environmental settings.
+
+
+
+ Constructor with no included items specified, for use
+ with named property syntax.
+
+
+
+ Constructor taking one or more included items
+
+ Comma-delimited list of included items
+
+
+ Name of the item that is needed in order for
+ a test to run. Multiple itemss may be given,
+ separated by a comma.
+
+
+
+ Name of the item to be excluded. Multiple items
+ may be given, separated by a comma.
+
+
+
+ The reason for including or excluding the test
+
+
+
+ PlatformAttribute is used to mark a test fixture or an
+ individual method as applying to a particular platform only.
+
+
+
+ Constructor with no platforms specified, for use
+ with named property syntax.
+
+
+
+ Constructor taking one or more platforms
+
+ Comma-deliminted list of platforms
+
+
+ CultureAttribute is used to mark a test fixture or an
+ individual method as applying to a particular Culture only.
+
+
+
+ Constructor with no cultures specified, for use
+ with named property syntax.
+
+
+
+ Constructor taking one or more cultures
+
+ Comma-deliminted list of cultures
+
+
+ Marks a test to use a combinatorial join of any argument data
+ provided. NUnit will create a test case for every combination of
+ the arguments provided. This can result in a large number of test
+ cases and so should be used judiciously. This is the default join
+ type, so the attribute need not be used except as documentation.
+
+
+
+ Default constructor
+
+
+
+ Marks a test to use pairwise join of any argument data provided.
+ NUnit will attempt too excercise every pair of argument values at
+ least once, using as small a number of test cases as it can. With
+ only two arguments, this is the same as a combinatorial join.
+
+
+
+ Default constructor
+
+
+
+ Marks a test to use a sequential join of any argument data
+ provided. NUnit will use arguements for each parameter in
+ sequence, generating test cases up to the largest number
+ of argument values provided and using null for any arguments
+ for which it runs out of values. Normally, this should be
+ used with the same number of arguments for each parameter.
+
+
+
+ Default constructor
+
+
+
+ Summary description for MaxTimeAttribute.
+
+
+
+ Construct a MaxTimeAttribute, given a time in milliseconds.
+
+ The maximum elapsed time in milliseconds
+
+
+ PropertyAttribute is used to attach information to a test as a name/value pair..
+
+
+
+ Construct a PropertyAttribute with a name and string value
+
+ The name of the property
+ The property value
+
+
+ Construct a PropertyAttribute with a name and int value
+
+ The name of the property
+ The property value
+
+
+ Construct a PropertyAttribute with a name and double value
+
+ The name of the property
+ The property value
+
+
+ Constructor for derived classes that set the
+ property dictionary directly.
+
+
+
+ Constructor for use by derived classes that use the
+ name of the type as the property name. Derived classes
+ must ensure that the Type of the property value is
+ a standard type supported by the BCL. Any custom
+ types will cause a serialization Exception when
+ in the client.
+
+
+
+ Gets the property dictionary for this attribute
+
+
+
+ RandomAttribute is used to supply a set of random values
+ to a single parameter of a parameterized test.
+
+
+
+ Construct a set of doubles from 0.0 to 1.0,
+ specifying only the count.
+
+
+
+
+ Construct a set of doubles from min to max
+
+
+
+
+
+
+ Construct a set of ints from min to max
+
+
+
+
+
+
+ Get the collection of values to be used as arguments
+
+
+
+ RangeAttribute is used to supply a range of values to an
+ individual parameter of a parameterized test.
+
+
+
+ Construct a range of ints using default step of 1
+
+
+
+
+
+ Construct a range of ints specifying the step size
+
+
+
+
+
+
+ Construct a range of longs
+
+
+
+
+
+
+ Construct a range of doubles
+
+
+
+
+
+
+ Construct a range of floats
+
+
+
+
+
+
+ RepeatAttribute may be applied to test case in order
+ to run it multiple times.
+
+
+
+ Construct a RepeatAttribute
+
+ The number of times to run the test
+
+
+ RequiredAddinAttribute may be used to indicate the names of any addins
+ that must be present in order to run some or all of the tests in an
+ assembly. If the addin is not loaded, the entire assembly is marked
+ as NotRunnable.
+
+
+
+ Initializes a new instance of the class.
+
+ The required addin.
+
+
+ Gets the name of required addin.
+
+ The required addin name.
+
+
+ Summary description for SetCultureAttribute.
+
+
+
+ Construct given the name of a culture
+
+
+
+
+ Summary description for SetUICultureAttribute.
+
+
+
+ Construct given the name of a culture
+
+
+
+
+ SetUpAttribute is used in a TestFixture to identify a method
+ that is called immediately before each test is run. It is
+ also used in a SetUpFixture to identify the method that is
+ called once, before any of the subordinate tests are run.
+
+
+
+ Attribute used to mark a class that contains one-time SetUp
+ and/or TearDown methods that apply to all the tests in a
+ namespace or an assembly.
+
+
+
+ Attribute used to mark a static (shared in VB) property
+ that returns a list of tests.
+
+
+
+ Attribute used in a TestFixture to identify a method that is
+ called immediately after each test is run. It is also used
+ in a SetUpFixture to identify the method that is called once,
+ after all subordinate tests have run. In either case, the method
+ is guaranteed to be called, even if an exception is thrown.
+
+
+
+ Provide actions to execute before and after tests.
+
+
+
+ Adding this attribute to a method within a
+ class makes the method callable from the NUnit test runner. There is a property
+ called Description which is optional which you can provide a more detailed test
+ description. This class cannot be inherited.
+
+
+ [TestFixture]
+ public class Fixture
+ {
+ [Test]
+ public void MethodToTest()
+ {}
+ [Test(Description = "more detailed description")]
+ publc void TestDescriptionMethod()
+ {}
+ }
+
+
+
+ Descriptive text for this test
+
+
+
+ TestCaseAttribute is used to mark parameterized test cases
+ and provide them with their arguments.
+
+
+
+ Construct a TestCaseAttribute with a list of arguments.
+ This constructor is not CLS-Compliant
+
+
+
+
+ Construct a TestCaseAttribute with a single argument
+
+
+
+
+ Construct a TestCaseAttribute with a two arguments
+
+
+
+
+
+ Construct a TestCaseAttribute with a three arguments
+
+
+
+
+
+
+ Gets the list of arguments to a test case
+
+
+
+ Gets or sets the expected result. Use
+ ExpectedResult by preference.
+
+ The result.
+
+
+ Gets or sets the expected result.
+
+ The result.
+
+
+ Gets a flag indicating whether an expected
+ result has been set.
+
+
+
+ Gets a list of categories associated with this test;
+
+
+
+ Gets or sets the category associated with this test.
+ May be a single category or a comma-separated list.
+
+
+
+ Gets or sets the expected exception.
+
+ The expected exception.
+
+
+ Gets or sets the name the expected exception.
+
+ The expected name of the exception.
+
+
+ Gets or sets the expected message of the expected exception
+
+ The expected message of the exception.
+
+
+ Gets or sets the type of match to be performed on the expected message
+
+
+
+ Gets or sets the description.
+
+ The description.
+
+
+ Gets or sets the name of the test.
+
+ The name of the test.
+
+
+ Gets or sets the ignored status of the test
+
+
+
+ Gets or sets the ignored status of the test
+
+
+
+ Gets or sets the explicit status of the test
+
+
+
+ Gets or sets the reason for not running the test
+
+
+
+ Gets or sets the reason for not running the test.
+ Set has the side effect of marking the test as ignored.
+
+ The ignore reason.
+
+
+ FactoryAttribute indicates the source to be used to
+ provide test cases for a test method.
+
+
+
+ Construct with the name of the data source, which must
+ be a property, field or method of the test class itself.
+
+ An array of the names of the factories that will provide data
+
+
+ Construct with a Type, which must implement IEnumerable
+
+ The Type that will provide data
+
+
+ Construct with a Type and name.
+ that don't support params arrays.
+
+ The Type that will provide data
+ The name of the method, property or field that will provide data
+
+
+ The name of a the method, property or fiend to be used as a source
+
+
+
+ A Type to be used as a source
+
+
+
+ Gets or sets the category associated with this test.
+ May be a single category or a comma-separated list.
+
+
+
+ [TestFixture]
+ public class ExampleClass
+ {}
+
+
+
+ Default constructor
+
+
+
+ Construct with a object[] representing a set of arguments.
+ In .NET 2.0, the arguments may later be separated into
+ type arguments and constructor arguments.
+
+
+
+
+ Descriptive text for this fixture
+
+
+
+ Gets and sets the category for this fixture.
+ May be a comma-separated list of categories.
+
+
+
+ Gets a list of categories for this fixture
+
+
+
+ The arguments originally provided to the attribute
+
+
+
+ Gets or sets a value indicating whether this should be ignored.
+
+ true if ignore; otherwise, false.
+
+
+ Gets or sets the ignore reason. May set Ignored as a side effect.
+
+ The ignore reason.
+
+
+ Get or set the type arguments. If not set
+ explicitly, any leading arguments that are
+ Types are taken as type arguments.
+
+
+
+ Attribute used to identify a method that is
+ called before any tests in a fixture are run.
+
+
+
+ Attribute used to identify a method that is called after
+ all the tests in a fixture have run. The method is
+ guaranteed to be called, even if an exception is thrown.
+
+
+
+ Adding this attribute to a method within a
+ class makes the method callable from the NUnit test runner. There is a property
+ called Description which is optional which you can provide a more detailed test
+ description. This class cannot be inherited.
+
+
+ [TestFixture]
+ public class Fixture
+ {
+ [Test]
+ public void MethodToTest()
+ {}
+ [Test(Description = "more detailed description")]
+ publc void TestDescriptionMethod()
+ {}
+ }
+
+
+
+ Used on a method, marks the test with a timeout value in milliseconds.
+ The test will be run in a separate thread and is cancelled if the timeout
+ is exceeded. Used on a method or assembly, sets the default timeout
+ for all contained test methods.
+
+
+
+ Construct a TimeoutAttribute given a time in milliseconds
+
+ The timeout value in milliseconds
+
+
+ Marks a test that must run in the STA, causing it
+ to run in a separate thread if necessary.
+ On methods, you may also use STAThreadAttribute
+ to serve the same purpose.
+
+
+
+ Construct a RequiresSTAAttribute
+
+
+
+ Marks a test that must run in the MTA, causing it
+ to run in a separate thread if necessary.
+ On methods, you may also use MTAThreadAttribute
+ to serve the same purpose.
+
+
+
+ Construct a RequiresMTAAttribute
+
+
+
+ Marks a test that must run on a separate thread.
+
+
+
+ Construct a RequiresThreadAttribute
+
+
+
+ Construct a RequiresThreadAttribute, specifying the apartment
+
+
+
+ Abstract base class for attributes that apply to parameters
+ and supply data for the parameter.
+
+
+
+ Gets the data to be provided to the specified parameter
+
+
+
+ ValuesAttribute is used to provide literal arguments for
+ an individual parameter of a test.
+
+
+
+ The collection of data to be returned. Must
+ be set by any derived attribute classes.
+ We use an object[] so that the individual
+ elements may have their type changed in GetData
+ if necessary.
+
+
+
+ Construct with one argument
+
+
+
+
+ Construct with two arguments
+
+
+
+
+
+ Construct with three arguments
+
+
+
+
+
+
+ Construct with an array of arguments
+
+
+
+
+ Get the collection of values to be used as arguments
+
+
+
+ ValueSourceAttribute indicates the source to be used to
+ provide data for one parameter of a test method.
+
+
+
+ Construct with the name of the factory - for use with languages
+ that don't support params arrays.
+
+ The name of the data source to be used
+
+
+ Construct with a Type and name - for use with languages
+ that don't support params arrays.
+
+ The Type that will provide data
+ The name of the method, property or field that will provide data
+
+
+ The name of a the method, property or fiend to be used as a source
+
+
+
+ A Type to be used as a source
+
+
+
+ A set of Assert methods operationg on one or more collections
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+ Asserts that all items contained in collection are of the type specified by expectedType.
+
+ IEnumerable containing objects to be considered
+ System.Type that all objects in collection must be instances of
+
+
+ Asserts that all items contained in collection are of the type specified by expectedType.
+
+ IEnumerable containing objects to be considered
+ System.Type that all objects in collection must be instances of
+ The message that will be displayed on failure
+
+
+ Asserts that all items contained in collection are of the type specified by expectedType.
+
+ IEnumerable containing objects to be considered
+ System.Type that all objects in collection must be instances of
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that all items contained in collection are not equal to null.
+
+ IEnumerable containing objects to be considered
+
+
+ Asserts that all items contained in collection are not equal to null.
+
+ IEnumerable containing objects to be considered
+ The message that will be displayed on failure
+
+
+ Asserts that all items contained in collection are not equal to null.
+
+ IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Ensures that every object contained in collection exists within the collection
+ once and only once.
+
+ IEnumerable of objects to be considered
+
+
+ Ensures that every object contained in collection exists within the collection
+ once and only once.
+
+ IEnumerable of objects to be considered
+ The message that will be displayed on failure
+
+
+ Ensures that every object contained in collection exists within the collection
+ once and only once.
+
+ IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+ The message that will be displayed on failure
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+
+
+ Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+
+
+ Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that expected and actual are not exactly equal.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+
+
+ Asserts that expected and actual are not exactly equal.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+
+
+ Asserts that expected and actual are not exactly equal.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+
+
+ Asserts that expected and actual are not exactly equal.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+ The message that will be displayed on failure
+
+
+ Asserts that expected and actual are not exactly equal.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that expected and actual are not exactly equal.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that expected and actual are not equivalent.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+
+
+ Asserts that expected and actual are not equivalent.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+
+
+ Asserts that expected and actual are not equivalent.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that collection contains actual as an item.
+
+ IEnumerable of objects to be considered
+ Object to be found within collection
+
+
+ Asserts that collection contains actual as an item.
+
+ IEnumerable of objects to be considered
+ Object to be found within collection
+ The message that will be displayed on failure
+
+
+ Asserts that collection contains actual as an item.
+
+ IEnumerable of objects to be considered
+ Object to be found within collection
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that collection does not contain actual as an item.
+
+ IEnumerable of objects to be considered
+ Object that cannot exist within collection
+
+
+ Asserts that collection does not contain actual as an item.
+
+ IEnumerable of objects to be considered
+ Object that cannot exist within collection
+ The message that will be displayed on failure
+
+
+ Asserts that collection does not contain actual as an item.
+
+ IEnumerable of objects to be considered
+ Object that cannot exist within collection
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that superset is not a subject of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+
+
+ Asserts that superset is not a subject of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+ The message that will be displayed on failure
+
+
+ Asserts that superset is not a subject of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that superset is a subset of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+
+
+ Asserts that superset is a subset of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+ The message that will be displayed on failure
+
+
+ Asserts that superset is a subset of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+
+
+ Assert that an array,list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+
+
+ Assert that an array,list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+ A custom comparer to perform the comparisons
+ The message to be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+ A custom comparer to perform the comparisons
+ The message to be displayed on failure
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+ A custom comparer to perform the comparisons
+
+
+ AttributeExistsConstraint tests for the presence of a
+ specified attribute on a Type.
+
+
+
+ Constructs an AttributeExistsConstraint for a specific attribute Type
+
+
+
+
+ Tests whether the object provides the expected attribute.
+
+ A Type, MethodInfo, or other ICustomAttributeProvider
+ True if the expected attribute is present, otherwise false
+
+
+ Writes the description of the constraint to the specified writer
+
+
+
+ AttributeConstraint tests that a specified attribute is present
+ on a Type or other provider and that the value of the attribute
+ satisfies some other constraint.
+
+
+
+ Constructs an AttributeConstraint for a specified attriute
+ Type and base constraint.
+
+
+
+
+
+ Determines whether the Type or other provider has the
+ expected attribute and if its value matches the
+ additional constraint specified.
+
+
+
+ Writes a description of the attribute to the specified writer.
+
+
+
+ Writes the actual value supplied to the specified writer.
+
+
+
+ Returns a string representation of the constraint.
+
+
+
+ BasicConstraint is the abstract base for constraints that
+ perform a simple comparison to a constant value.
+
+
+
+ Initializes a new instance of the class.
+
+ The expected.
+ The description.
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ NullConstraint tests that the actual value is null
+
+
+
+ Initializes a new instance of the class.
+
+
+
+ TrueConstraint tests that the actual value is true
+
+
+
+ Initializes a new instance of the class.
+
+
+
+ FalseConstraint tests that the actual value is false
+
+
+
+ Initializes a new instance of the class.
+
+
+
+ NaNConstraint tests that the actual value is a double or float NaN
+
+
+
+ Test that the actual value is an NaN
+
+
+
+
+
+ Write the constraint description to a specified writer
+
+
+
+
+ BinaryConstraint is the abstract base of all constraints
+ that combine two other constraints in some fashion.
+
+
+
+ The first constraint being combined
+
+
+
+ The second constraint being combined
+
+
+
+ Construct a BinaryConstraint from two other constraints
+
+ The first constraint
+ The second constraint
+
+
+ AndConstraint succeeds only if both members succeed.
+
+
+
+ Create an AndConstraint from two other constraints
+
+ The first constraint
+ The second constraint
+
+
+ Apply both member constraints to an actual value, succeeding
+ succeeding only if both of them succeed.
+
+ The actual value
+ True if the constraints both succeeded
+
+
+ Write a description for this contraint to a MessageWriter
+
+ The MessageWriter to receive the description
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+ OrConstraint succeeds if either member succeeds
+
+
+
+ Create an OrConstraint from two other constraints
+
+ The first constraint
+ The second constraint
+
+
+ Apply the member constraints to an actual value, succeeding
+ succeeding as soon as one of them succeeds.
+
+ The actual value
+ True if either constraint succeeded
+
+
+ Write a description for this contraint to a MessageWriter
+
+ The MessageWriter to receive the description
+
+
+ CollectionConstraint is the abstract base class for
+ constraints that operate on collections.
+
+
+
+ Construct an empty CollectionConstraint
+
+
+
+ Construct a CollectionConstraint
+
+
+
+
+ Determines whether the specified enumerable is empty.
+
+ The enumerable.
+
+ true if the specified enumerable is empty; otherwise, false.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Protected method to be implemented by derived classes
+
+
+
+
+
+ CollectionItemsEqualConstraint is the abstract base class for all
+ collection constraints that apply some notion of item equality
+ as a part of their operation.
+
+
+
+ Construct an empty CollectionConstraint
+
+
+
+ Construct a CollectionConstraint
+
+
+
+
+ Flag the constraint to ignore case and return self.
+
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied Comparison object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Compares two collection members for equality
+
+
+
+ Return a new CollectionTally for use in making tests
+
+ The collection to be included in the tally
+
+
+ EmptyCollectionConstraint tests whether a collection is empty.
+
+
+
+ Check that the collection is empty
+
+
+
+
+
+ Write the constraint description to a MessageWriter
+
+
+
+
+ UniqueItemsConstraint tests whether all the items in a
+ collection are unique.
+
+
+
+ Check that all items are unique.
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+ CollectionContainsConstraint is used to test whether a collection
+ contains an expected object as a member.
+
+
+
+ Construct a CollectionContainsConstraint
+
+
+
+
+ Test whether the expected item is contained in the collection
+
+
+
+
+
+ Write a descripton of the constraint to a MessageWriter
+
+
+
+
+ CollectionEquivalentCOnstraint is used to determine whether two
+ collections are equivalent.
+
+
+
+ Construct a CollectionEquivalentConstraint
+
+
+
+
+ Test whether two collections are equivalent
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+ CollectionSubsetConstraint is used to determine whether
+ one collection is a subset of another
+
+
+
+ Construct a CollectionSubsetConstraint
+
+ The collection that the actual value is expected to be a subset of
+
+
+ Test whether the actual collection is a subset of
+ the expected collection provided.
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+ CollectionOrderedConstraint is used to test whether a collection is ordered.
+
+
+
+ Construct a CollectionOrderedConstraint
+
+
+
+ If used performs a reverse comparison
+
+
+
+ Modifies the constraint to use an IComparer and returns self.
+
+
+
+ Modifies the constraint to use an IComparer<T> and returns self.
+
+
+
+ Modifies the constraint to use a Comparison<T> and returns self.
+
+
+
+ Modifies the constraint to test ordering by the value of
+ a specified property and returns self.
+
+
+
+ Test whether the collection is ordered
+
+
+
+
+
+ Write a description of the constraint to a MessageWriter
+
+
+
+
+ Returns the string representation of the constraint.
+
+
+
+
+ CollectionTally counts (tallies) the number of
+ occurences of each object in one or more enumerations.
+
+
+
+ Construct a CollectionTally object from a comparer and a collection
+
+
+
+ The number of objects remaining in the tally
+
+
+
+ Try to remove an object from the tally
+
+ The object to remove
+ True if successful, false if the object was not found
+
+
+ Try to remove a set of objects from the tally
+
+ The objects to remove
+ True if successful, false if any object was not found
+
+
+ ComparisonAdapter class centralizes all comparisons of
+ values in NUnit, adapting to the use of any provided
+ IComparer, IComparer<T> or Comparison<T>
+
+
+
+ Gets the default ComparisonAdapter, which wraps an
+ NUnitComparer object.
+
+
+
+ Returns a ComparisonAdapter that wraps an IComparer
+
+
+
+ Returns a ComparisonAdapter that wraps an IComparer<T>
+
+
+
+ Returns a ComparisonAdapter that wraps a Comparison<T>
+
+
+
+ Compares two objects
+
+
+
+ Construct a default ComparisonAdapter
+
+
+
+ Construct a ComparisonAdapter for an IComparer
+
+
+
+ Compares two objects
+
+
+
+
+
+
+ ComparisonAdapter<T> extends ComparisonAdapter and
+ allows use of an IComparer<T> or Comparison<T>
+ to actually perform the comparison.
+
+
+
+ Construct a ComparisonAdapter for an IComparer<T>
+
+
+
+ Compare a Type T to an object
+
+
+
+ Construct a ComparisonAdapter for a Comparison<T>
+
+
+
+ Compare a Type T to an object
+
+
+
+ Abstract base class for constraints that compare values to
+ determine if one is greater than, equal to or less than
+ the other. This class supplies the Using modifiers.
+
+
+
+ ComparisonAdapter to be used in making the comparison
+
+
+
+ Initializes a new instance of the class.
+
+
+
+ Initializes a new instance of the class.
+
+
+
+ Modifies the constraint to use an IComparer and returns self
+
+
+
+ Modifies the constraint to use an IComparer<T> and returns self
+
+
+
+ Modifies the constraint to use a Comparison<T> and returns self
+
+
+
+ Delegate used to delay evaluation of the actual value
+ to be used in evaluating a constraint
+
+
+
+ The Constraint class is the base of all built-in constraints
+ within NUnit. It provides the operator overloads used to combine
+ constraints.
+
+
+
+ Class used to detect any derived constraints
+ that fail to set the actual value in their
+ Matches override.
+
+
+
+ Static UnsetObject used to detect derived constraints
+ failing to set the actual value.
+
+
+
+ The actual value being tested against a constraint
+
+
+
+ The display name of this Constraint for use by ToString()
+
+
+
+ Argument fields used by ToString();
+
+
+
+ The builder holding this constraint
+
+
+
+ Construct a constraint with no arguments
+
+
+
+ Construct a constraint with one argument
+
+
+
+ Construct a constraint with two arguments
+
+
+
+ Sets the ConstraintBuilder holding this constraint
+
+
+
+ The display name of this Constraint for use by ToString().
+ The default value is the name of the constraint with
+ trailing "Constraint" removed. Derived classes may set
+ this to another name in their constructors.
+
+
+
+ Write the failure message to the MessageWriter provided
+ as an argument. The default implementation simply passes
+ the constraint and the actual value to the writer, which
+ then displays the constraint description and the value.
+ Constraints that need to provide additional details,
+ such as where the error occured can override this.
+
+ The MessageWriter on which to display the message
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Test whether the constraint is satisfied by an
+ ActualValueDelegate that returns the value to be tested.
+ The default implementation simply evaluates the delegate
+ but derived classes may override it to provide for delayed
+ processing.
+
+ An ActualValueDelegate
+ True for success, false for failure
+
+
+ Test whether the constraint is satisfied by a given reference.
+ The default implementation simply dereferences the value but
+ derived classes may override it to provide for delayed processing.
+
+ A reference to the value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+ Default override of ToString returns the constraint DisplayName
+ followed by any arguments within angle brackets.
+
+
+
+
+ Returns the string representation of this constraint
+
+
+
+ This operator creates a constraint that is satisfied only if both
+ argument constraints are satisfied.
+
+
+
+ This operator creates a constraint that is satisfied if either
+ of the argument constraints is satisfied.
+
+
+
+ This operator creates a constraint that is satisfied if the
+ argument constraint is not satisfied.
+
+
+
+ Returns a ConstraintExpression by appending And
+ to the current constraint.
+
+
+
+ Returns a ConstraintExpression by appending And
+ to the current constraint.
+
+
+
+ Returns a ConstraintExpression by appending Or
+ to the current constraint.
+
+
+
+ Returns a DelayedConstraint with the specified delay time.
+
+ The delay in milliseconds.
+
+
+
+ Returns a DelayedConstraint with the specified delay time
+ and polling interval.
+
+ The delay in milliseconds.
+ The interval at which to test the constraint.
+
+
+
+ ConstraintBuilder maintains the stacks that are used in
+ processing a ConstraintExpression. An OperatorStack
+ is used to hold operators that are waiting for their
+ operands to be reognized. a ConstraintStack holds
+ input constraints as well as the results of each
+ operator applied.
+
+
+
+ OperatorStack is a type-safe stack for holding ConstraintOperators
+
+
+
+ Initializes a new instance of the class.
+
+ The builder.
+
+
+ Gets a value indicating whether this is empty.
+
+ true if empty; otherwise, false.
+
+
+ Gets the topmost operator without modifying the stack.
+
+ The top.
+
+
+ Pushes the specified operator onto the stack.
+
+ The op.
+
+
+ Pops the topmost operator from the stack.
+
+
+
+
+ ConstraintStack is a type-safe stack for holding Constraints
+
+
+
+ Initializes a new instance of the class.
+
+ The builder.
+
+
+ Gets a value indicating whether this is empty.
+
+ true if empty; otherwise, false.
+
+
+ Gets the topmost constraint without modifying the stack.
+
+ The topmost constraint
+
+
+ Pushes the specified constraint. As a side effect,
+ the constraint's builder field is set to the
+ ConstraintBuilder owning this stack.
+
+ The constraint.
+
+
+ Pops this topmost constrait from the stack.
+ As a side effect, the constraint's builder
+ field is set to null.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+ Gets a value indicating whether this instance is resolvable.
+
+
+ true if this instance is resolvable; otherwise, false.
+
+
+
+ Appends the specified operator to the expression by first
+ reducing the operator stack and then pushing the new
+ operator on the stack.
+
+ The operator to push.
+
+
+ Appends the specified constraint to the expresson by pushing
+ it on the constraint stack.
+
+ The constraint to push.
+
+
+ Sets the top operator right context.
+
+ The right context.
+
+
+ Reduces the operator stack until the topmost item
+ precedence is greater than or equal to the target precedence.
+
+ The target precedence.
+
+
+ Resolves this instance, returning a Constraint. If the builder
+ is not currently in a resolvable state, an exception is thrown.
+
+ The resolved constraint
+
+
+ ConstraintExpression represents a compound constraint in the
+ process of being constructed from a series of syntactic elements.
+ Individual elements are appended to the expression as they are
+ reognized. Once an actual Constraint is appended, the expression
+ returns a resolvable Constraint.
+
+
+
+ Initializes a new instance of the class.
+
+
+
+ Initializes a new instance of the
+ class passing in a ConstraintBuilder, which may be pre-populated.
+
+ The builder.
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them succeed.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if at least one of them succeeds.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them fail.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding only if a specified number of them succeed.
+
+
+
+ Returns a new PropertyConstraintExpression, which will either
+ test for the existence of the named property on the object
+ being tested or apply any following constraint to that property.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Length property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Count property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Message property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the InnerException property of the object being tested.
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+ With is currently a NOP - reserved for future use.
+
+
+
+ Returns the constraint provided as an argument - used to allow custom
+ custom constraints to easily participate in the syntax.
+
+
+
+ Returns the constraint provided as an argument - used to allow custom
+ custom constraints to easily participate in the syntax.
+
+
+
+ Returns a constraint that tests for null
+
+
+
+ Returns a constraint that tests for True
+
+
+
+ Returns a constraint that tests for False
+
+
+
+ Returns a constraint that tests for a positive value
+
+
+
+ Returns a constraint that tests for a negative value
+
+
+
+ Returns a constraint that tests for NaN
+
+
+
+ Returns a constraint that tests for empty
+
+
+
+ Returns a constraint that tests whether a collection
+ contains all unique items.
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in binary format.
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in xml format.
+
+
+
+ Returns a constraint that tests two items for equality
+
+
+
+ Returns a constraint that tests that two references are the same object
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a collection containing the same elements as the
+ collection supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a subset of the collection supplied as an argument.
+
+
+
+ Returns a constraint that tests whether a collection is ordered
+
+
+
+ Returns a new CollectionContainsConstraint checking for the
+ presence of a particular object in the collection.
+
+
+
+ Returns a new CollectionContainsConstraint checking for the
+ presence of a particular object in the collection.
+
+
+
+ Returns a new ContainsConstraint. This constraint
+ will, in turn, make use of the appropriate second-level
+ constraint, depending on the type of the actual argument.
+ This overload is only used if the item sought is a string,
+ since any other type implies that we are looking for a
+ collection member.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the Regex pattern supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the Regex pattern supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same as an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same path or under an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same path or under an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the actual value falls
+ within a specified range.
+
+
+
+ ConstraintExpressionBase is the abstract base class for the
+ ConstraintExpression class, which represents a
+ compound constraint in the process of being constructed
+ from a series of syntactic elements.
+ NOTE: ConstraintExpressionBase is separate because the
+ ConstraintExpression class was generated in earlier
+ versions of NUnit. The two classes may be combined
+ in a future version.
+
+
+
+ The ConstraintBuilder holding the elements recognized so far
+
+
+
+ Initializes a new instance of the class.
+
+
+
+ Initializes a new instance of the
+ class passing in a ConstraintBuilder, which may be pre-populated.
+
+ The builder.
+
+
+ Returns a string representation of the expression as it
+ currently stands. This should only be used for testing,
+ since it has the side-effect of resolving the expression.
+
+
+
+
+ Appends an operator to the expression and returns the
+ resulting expression itself.
+
+
+
+ Appends a self-resolving operator to the expression and
+ returns a new ResolvableConstraintExpression.
+
+
+
+ Appends a constraint to the expression and returns that
+ constraint, which is associated with the current state
+ of the expression being built.
+
+
+
+ Helper class with properties and methods that supply
+ a number of constraints used in Asserts.
+
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them succeed.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if at least one of them succeeds.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them fail.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding only if a specified number of them succeed.
+
+
+
+ Returns a new PropertyConstraintExpression, which will either
+ test for the existence of the named property on the object
+ being tested or apply any following constraint to that property.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Length property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Count property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Message property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the InnerException property of the object being tested.
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+ Returns a constraint that tests for null
+
+
+
+ Returns a constraint that tests for True
+
+
+
+ Returns a constraint that tests for False
+
+
+
+ Returns a constraint that tests for a positive value
+
+
+
+ Returns a constraint that tests for a negative value
+
+
+
+ Returns a constraint that tests for NaN
+
+
+
+ Returns a constraint that tests for empty
+
+
+
+ Returns a constraint that tests whether a collection
+ contains all unique items.
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in binary format.
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in xml format.
+
+
+
+ Returns a constraint that tests two items for equality
+
+
+
+ Returns a constraint that tests that two references are the same object
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a collection containing the same elements as the
+ collection supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a subset of the collection supplied as an argument.
+
+
+
+ Returns a constraint that tests whether a collection is ordered
+
+
+
+ Returns a new CollectionContainsConstraint checking for the
+ presence of a particular object in the collection.
+
+
+
+ Returns a new CollectionContainsConstraint checking for the
+ presence of a particular object in the collection.
+
+
+
+ Returns a new ContainsConstraint. This constraint
+ will, in turn, make use of the appropriate second-level
+ constraint, depending on the type of the actual argument.
+ This overload is only used if the item sought is a string,
+ since any other type implies that we are looking for a
+ collection member.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+ Returns a constraint that fails if the actual
+ value contains the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+ Returns a constraint that fails if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+ Returns a constraint that fails if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the Regex pattern supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the Regex pattern supplied as an argument.
+
+
+
+ Returns a constraint that fails if the actual
+ value matches the pattern supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same as an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same path or under an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same path or under an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the actual value falls
+ within a specified range.
+
+
+
+ The ConstraintOperator class is used internally by a
+ ConstraintBuilder to represent an operator that
+ modifies or combines constraints.
+ Constraint operators use left and right precedence
+ values to determine whether the top operator on the
+ stack should be reduced before pushing a new operator.
+
+
+
+ The precedence value used when the operator
+ is about to be pushed to the stack.
+
+
+
+ The precedence value used when the operator
+ is on the top of the stack.
+
+
+
+ The syntax element preceding this operator
+
+
+
+ The syntax element folowing this operator
+
+
+
+ The precedence value used when the operator
+ is about to be pushed to the stack.
+
+
+
+ The precedence value used when the operator
+ is on the top of the stack.
+
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+
+ PrefixOperator takes a single constraint and modifies
+ it's action in some way.
+
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+
+ Returns the constraint created by applying this
+ prefix to another constraint.
+
+
+
+
+
+ Negates the test of the constraint it wraps.
+
+
+
+ Constructs a new NotOperator
+
+
+
+ Returns a NotConstraint applied to its argument.
+
+
+
+ Abstract base for operators that indicate how to
+ apply a constraint to items in a collection.
+
+
+
+ Constructs a CollectionOperator
+
+
+
+ Represents a constraint that succeeds if all the
+ members of a collection match a base constraint.
+
+
+
+ Returns a constraint that will apply the argument
+ to the members of a collection, succeeding if
+ they all succeed.
+
+
+
+ Represents a constraint that succeeds if any of the
+ members of a collection match a base constraint.
+
+
+
+ Returns a constraint that will apply the argument
+ to the members of a collection, succeeding if
+ any of them succeed.
+
+
+
+ Represents a constraint that succeeds if none of the
+ members of a collection match a base constraint.
+
+
+
+ Returns a constraint that will apply the argument
+ to the members of a collection, succeeding if
+ none of them succeed.
+
+
+
+ Represents a constraint that succeeds if the specified
+ count of members of a collection match a base constraint.
+
+
+
+ Construct an ExactCountOperator for a specified count
+
+ The expected count
+
+
+ Returns a constraint that will apply the argument
+ to the members of a collection, succeeding if
+ none of them succeed.
+
+
+
+ Represents a constraint that simply wraps the
+ constraint provided as an argument, without any
+ further functionality, but which modifes the
+ order of evaluation because of its precedence.
+
+
+
+ Constructor for the WithOperator
+
+
+
+ Returns a constraint that wraps its argument
+
+
+
+ Abstract base class for operators that are able to reduce to a
+ constraint whether or not another syntactic element follows.
+
+
+
+ Operator used to test for the presence of a named Property
+ on an object and optionally apply further tests to the
+ value of that property.
+
+
+
+ Gets the name of the property to which the operator applies
+
+
+
+ Constructs a PropOperator for a particular named property
+
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+
+ Operator that tests for the presence of a particular attribute
+ on a type and optionally applies further tests to the attribute.
+
+
+
+ Construct an AttributeOperator for a particular Type
+
+ The Type of attribute tested
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+ Operator that tests that an exception is thrown and
+ optionally applies further tests to the exception.
+
+
+
+ Construct a ThrowsOperator
+
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+ Abstract base class for all binary operators
+
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+
+ Gets the left precedence of the operator
+
+
+
+ Gets the right precedence of the operator
+
+
+
+ Abstract method that produces a constraint by applying
+ the operator to its left and right constraint arguments.
+
+
+
+ Operator that requires both it's arguments to succeed
+
+
+
+ Construct an AndOperator
+
+
+
+ Apply the operator to produce an AndConstraint
+
+
+
+ Operator that requires at least one of it's arguments to succeed
+
+
+
+ Construct an OrOperator
+
+
+
+ Apply the operator to produce an OrConstraint
+
+
+
+ ContainsConstraint tests a whether a string contains a substring
+ or a collection contains an object. It postpones the decision of
+ which test to use until the type of the actual argument is known.
+ This allows testing whether a string is contained in a collection
+ or as a substring of another string using the same syntax.
+
+
+
+ Initializes a new instance of the class.
+
+ The expected.
+
+
+ Flag the constraint to ignore case and return self.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied Comparison object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Applies a delay to the match so that a match can be evaluated in the future.
+
+
+
+ Creates a new DelayedConstraint
+
+ The inner constraint two decorate
+ The time interval after which the match is performed
+ If the value of is less than 0
+
+
+ Creates a new DelayedConstraint
+
+ The inner constraint two decorate
+ The time interval after which the match is performed
+ The time interval used for polling
+ If the value of is less than 0
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for if the base constraint fails, false if it succeeds
+
+
+ Test whether the constraint is satisfied by a delegate
+
+ The delegate whose value is to be tested
+ True for if the base constraint fails, false if it succeeds
+
+
+ Test whether the constraint is satisfied by a given reference.
+ Overridden to wait for the specified delay period before
+ calling the base constraint with the dereferenced value.
+
+ A reference to the value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a MessageWriter.
+
+ The writer on which the actual value is displayed
+
+
+ Returns the string representation of the constraint.
+
+
+
+ EmptyDirectoryConstraint is used to test that a directory is empty
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+ EmptyConstraint tests a whether a string or collection is empty,
+ postponing the decision about which test is applied until the
+ type of the actual argument is known.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ EqualConstraint is able to compare an actual value with the
+ expected value provided in its constructor. Two objects are
+ considered equal if both are null, or if both have the same
+ value. NUnit has special semantics for some object types.
+
+
+
+ If true, strings in error messages will be clipped
+
+
+
+ NUnitEqualityComparer used to test equality.
+
+
+
+ Initializes a new instance of the class.
+
+ The expected value.
+
+
+ Flag the constraint to ignore case and return self.
+
+
+
+ Flag the constraint to suppress string clipping
+ and return self.
+
+
+
+ Flag the constraint to compare arrays as collections
+ and return self.
+
+
+
+ Flag the constraint to use a tolerance when determining equality.
+
+ Tolerance value to be used
+ Self.
+
+
+ Switches the .Within() modifier to interpret its tolerance as
+ a distance in representable values (see remarks).
+
+ Self.
+
+ Ulp stands for "unit in the last place" and describes the minimum
+ amount a given value can change. For any integers, an ulp is 1 whole
+ digit. For floating point values, the accuracy of which is better
+ for smaller numbers and worse for larger numbers, an ulp depends
+ on the size of the number. Using ulps for comparison of floating
+ point results instead of fixed tolerances is safer because it will
+ automatically compensate for the added inaccuracy of larger numbers.
+
+
+
+ Switches the .Within() modifier to interpret its tolerance as
+ a percentage that the actual values is allowed to deviate from
+ the expected value.
+
+ Self
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in days.
+
+ Self
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in hours.
+
+ Self
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in minutes.
+
+ Self
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in seconds.
+
+ Self
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in milliseconds.
+
+ Self
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in clock ticks.
+
+ Self
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied Comparison object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write a failure message. Overridden to provide custom
+ failure messages for EqualConstraint.
+
+ The MessageWriter to write to
+
+
+ Write description of this constraint
+
+ The MessageWriter to write to
+
+
+ Display the failure information for two collections that did not match.
+
+ The MessageWriter on which to display
+ The expected collection.
+ The actual collection
+ The depth of this failure in a set of nested collections
+
+
+ Displays a single line showing the types and sizes of the expected
+ and actual enumerations, collections or arrays. If both are identical,
+ the value is only shown once.
+
+ The MessageWriter on which to display
+ The expected collection or array
+ The actual collection or array
+ The indentation level for the message line
+
+
+ Displays a single line showing the point in the expected and actual
+ arrays at which the comparison failed. If the arrays have different
+ structures or dimensions, both values are shown.
+
+ The MessageWriter on which to display
+ The expected array
+ The actual array
+ Index of the failure point in the underlying collections
+ The indentation level for the message line
+
+
+ Display the failure information for two IEnumerables that did not match.
+
+ The MessageWriter on which to display
+ The expected enumeration.
+ The actual enumeration
+ The depth of this failure in a set of nested collections
+
+
+ EqualityAdapter class handles all equality comparisons
+ that use an IEqualityComparer, IEqualityComparer<T>
+ or a ComparisonAdapter.
+
+
+
+ Compares two objects, returning true if they are equal
+
+
+
+ Returns true if the two objects can be compared by this adapter.
+ The base adapter cannot handle IEnumerables except for strings.
+
+
+
+ Returns an EqualityAdapter that wraps an IComparer.
+
+
+
+ EqualityAdapter that wraps an IComparer.
+
+
+
+ Returns an EqualityAdapter that wraps an IEqualityComparer.
+
+
+
+ Returns true if the two objects can be compared by this adapter.
+ Generic adapter requires objects of the specified type.
+
+
+
+ Returns an EqualityAdapter that wraps an IEqualityComparer<T>.
+
+
+
+ Returns an EqualityAdapter that wraps an IComparer<T>.
+
+
+
+ EqualityAdapter that wraps an IComparer.
+
+
+
+ Returns an EqualityAdapter that wraps a Comparison<T>.
+
+
+ Helper routines for working with floating point numbers
+
+
+ The floating point comparison code is based on this excellent article:
+ http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
+
+
+ "ULP" means Unit in the Last Place and in the context of this library refers to
+ the distance between two adjacent floating point numbers. IEEE floating point
+ numbers can only represent a finite subset of natural numbers, with greater
+ accuracy for smaller numbers and lower accuracy for very large numbers.
+
+
+ If a comparison is allowed "2 ulps" of deviation, that means the values are
+ allowed to deviate by up to 2 adjacent floating point values, which might be
+ as low as 0.0000001 for small numbers or as high as 10.0 for large numbers.
+
+
+
+ Union of a floating point variable and an integer
+
+ The union's value as a floating point variable
+
+ The union's value as an integer
+
+ The union's value as an unsigned integer
+
+ Union of a double precision floating point variable and a long
+
+ The union's value as a double precision floating point variable
+
+ The union's value as a long
+
+ The union's value as an unsigned long
+
+ Compares two floating point values for equality
+ First floating point value to be compared
+ Second floating point value t be compared
+
+ Maximum number of representable floating point values that are allowed to
+ be between the left and the right floating point values
+
+ True if both numbers are equal or close to being equal
+
+
+ Floating point values can only represent a finite subset of natural numbers.
+ For example, the values 2.00000000 and 2.00000024 can be stored in a float,
+ but nothing inbetween them.
+
+
+ This comparison will count how many possible floating point values are between
+ the left and the right number. If the number of possible values between both
+ numbers is less than or equal to maxUlps, then the numbers are considered as
+ being equal.
+
+
+ Implementation partially follows the code outlined here:
+ http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/
+
+
+
+ Compares two double precision floating point values for equality
+ First double precision floating point value to be compared
+ Second double precision floating point value t be compared
+
+ Maximum number of representable double precision floating point values that are
+ allowed to be between the left and the right double precision floating point values
+
+ True if both numbers are equal or close to being equal
+
+
+ Double precision floating point values can only represent a limited series of
+ natural numbers. For example, the values 2.0000000000000000 and 2.0000000000000004
+ can be stored in a double, but nothing inbetween them.
+
+
+ This comparison will count how many possible double precision floating point
+ values are between the left and the right number. If the number of possible
+ values between both numbers is less than or equal to maxUlps, then the numbers
+ are considered as being equal.
+
+
+ Implementation partially follows the code outlined here:
+ http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/
+
+
+
+
+ Reinterprets the memory contents of a floating point value as an integer value
+
+
+ Floating point value whose memory contents to reinterpret
+
+
+ The memory contents of the floating point value interpreted as an integer
+
+
+
+ Reinterprets the memory contents of a double precision floating point
+ value as an integer value
+
+
+ Double precision floating point value whose memory contents to reinterpret
+
+
+ The memory contents of the double precision floating point value
+ interpreted as an integer
+
+
+
+ Reinterprets the memory contents of an integer as a floating point value
+
+ Integer value whose memory contents to reinterpret
+
+ The memory contents of the integer value interpreted as a floating point value
+
+
+
+ Reinterprets the memory contents of an integer value as a double precision
+ floating point value
+
+ Integer whose memory contents to reinterpret
+
+ The memory contents of the integer interpreted as a double precision
+ floating point value
+
+
+
+ Tests whether a value is greater than the value supplied to its constructor
+
+
+
+ The value against which a comparison is to be made
+
+
+
+ Initializes a new instance of the class.
+
+ The expected value.
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Tests whether a value is greater than or equal to the value supplied to its constructor
+
+
+
+ The value against which a comparison is to be made
+
+
+
+ Initializes a new instance of the class.
+
+ The expected value.
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ The IConstraintExpression interface is implemented by all
+ complete and resolvable constraints and expressions.
+
+
+
+ Return the top-level constraint for this expression
+
+
+
+
+ Tests whether a value is less than the value supplied to its constructor
+
+
+
+ The value against which a comparison is to be made
+
+
+
+ Initializes a new instance of the class.
+
+ The expected value.
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Tests whether a value is less than or equal to the value supplied to its constructor
+
+
+
+ The value against which a comparison is to be made
+
+
+
+ Initializes a new instance of the class.
+
+ The expected value.
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ MessageWriter is the abstract base for classes that write
+ constraint descriptions and messages in some form. The
+ class has separate methods for writing various components
+ of a message, allowing implementations to tailor the
+ presentation as needed.
+
+
+
+ Construct a MessageWriter given a culture
+
+
+
+ Abstract method to get the max line length
+
+
+
+ Method to write single line message with optional args, usually
+ written to precede the general failure message.
+
+ The message to be written
+ Any arguments used in formatting the message
+
+
+ Method to write single line message with optional args, usually
+ written to precede the general failure message, at a givel
+ indentation level.
+
+ The indentation level of the message
+ The message to be written
+ Any arguments used in formatting the message
+
+
+ Display Expected and Actual lines for a constraint. This
+ is called by MessageWriter's default implementation of
+ WriteMessageTo and provides the generic two-line display.
+
+ The constraint that failed
+
+
+ Display Expected and Actual lines for given values. This
+ method may be called by constraints that need more control over
+ the display of actual and expected values than is provided
+ by the default implementation.
+
+ The expected value
+ The actual value causing the failure
+
+
+ Display Expected and Actual lines for given values, including
+ a tolerance value on the Expected line.
+
+ The expected value
+ The actual value causing the failure
+ The tolerance within which the test was made
+
+
+ Display the expected and actual string values on separate lines.
+ If the mismatch parameter is >=0, an additional line is displayed
+ line containing a caret that points to the mismatch point.
+
+ The expected string value
+ The actual string value
+ The point at which the strings don't match or -1
+ If true, case is ignored in locating the point where the strings differ
+ If true, the strings should be clipped to fit the line
+
+
+ Writes the text for a connector.
+
+ The connector.
+
+
+ Writes the text for a predicate.
+
+ The predicate.
+
+
+ Writes the text for an expected value.
+
+ The expected value.
+
+
+ Writes the text for a modifier
+
+ The modifier.
+
+
+ Writes the text for an actual value.
+
+ The actual value.
+
+
+ Writes the text for a generalized value.
+
+ The value.
+
+
+ Writes the text for a collection value,
+ starting at a particular point, to a max length
+
+ The collection containing elements to write.
+ The starting point of the elements to write
+ The maximum number of elements to write
+
+
+ Static methods used in creating messages
+
+
+
+ Static string used when strings are clipped
+
+
+
+ Returns the representation of a type as used in NUnitLite.
+ This is the same as Type.ToString() except for arrays,
+ which are displayed with their declared sizes.
+
+
+
+
+
+ Converts any control characters in a string
+ to their escaped representation.
+
+ The string to be converted
+ The converted string
+
+
+ Return the a string representation for a set of indices into an array
+
+ Array of indices for which a string is needed
+
+
+ Get an array of indices representing the point in a enumerable,
+ collection or array corresponding to a single int index into the
+ collection.
+
+ The collection to which the indices apply
+ Index in the collection
+ Array of indices
+
+
+ Clip a string to a given length, starting at a particular offset, returning the clipped
+ string with ellipses representing the removed parts
+
+ The string to be clipped
+ The maximum permitted length of the result string
+ The point at which to start clipping
+ The clipped string
+
+
+ Clip the expected and actual strings in a coordinated fashion,
+ so that they may be displayed together.
+
+
+
+
+
+
+
+ Shows the position two strings start to differ. Comparison
+ starts at the start index.
+
+ The expected string
+ The actual string
+ The index in the strings at which comparison should start
+ Boolean indicating whether case should be ignored
+ -1 if no mismatch found, or the index where mismatch found
+
+
+ The Numerics class contains common operations on numeric values.
+
+
+
+ Checks the type of the object, returning true if
+ the object is a numeric type.
+
+ The object to check
+ true if the object is a numeric type
+
+
+ Checks the type of the object, returning true if
+ the object is a floating point numeric type.
+
+ The object to check
+ true if the object is a floating point numeric type
+
+
+ Checks the type of the object, returning true if
+ the object is a fixed point numeric type.
+
+ The object to check
+ true if the object is a fixed point numeric type
+
+
+ Test two numeric values for equality, performing the usual numeric
+ conversions and using a provided or default tolerance. If the tolerance
+ provided is Empty, this method may set it to a default tolerance.
+
+ The expected value
+ The actual value
+ A reference to the tolerance in effect
+ True if the values are equal
+
+
+ Compare two numeric values, performing the usual numeric conversions.
+
+ The expected value
+ The actual value
+ The relationship of the values to each other
+
+
+ NUnitComparer encapsulates NUnit's default behavior
+ in comparing two objects.
+
+
+
+ Returns the default NUnitComparer.
+
+
+
+ Compares two objects
+
+
+
+
+
+
+ Generic version of NUnitComparer
+
+
+
+
+ Compare two objects of the same type
+
+
+
+ NUnitEqualityComparer encapsulates NUnit's handling of
+ equality tests between objects.
+
+
+
+ If true, all string comparisons will ignore case
+
+
+
+ If true, arrays will be treated as collections, allowing
+ those of different dimensions to be compared
+
+
+
+ Comparison objects used in comparisons for some constraints.
+
+
+
+ Returns the default NUnitEqualityComparer
+
+
+
+ Gets and sets a flag indicating whether case should
+ be ignored in determining equality.
+
+
+
+ Gets and sets a flag indicating that arrays should be
+ compared as collections, without regard to their shape.
+
+
+
+ Gets and sets an external comparer to be used to
+ test for equality. It is applied to members of
+ collections, in place of NUnit's own logic.
+
+
+
+ Gets the list of failure points for the last Match performed.
+
+
+
+ Compares two objects for equality within a tolerance.
+
+
+
+ Helper method to compare two arrays
+
+
+
+ Method to compare two DirectoryInfo objects
+
+ first directory to compare
+ second directory to compare
+ true if equivalent, false if not
+
+
+ FailurePoint class represents one point of failure
+ in an equality test.
+
+
+
+ The location of the failure
+
+
+
+ The expected value
+
+
+
+ The actual value
+
+
+
+ Indicates whether the expected value is valid
+
+
+
+ Indicates whether the actual value is valid
+
+
+
+ PathConstraint serves as the abstract base of constraints
+ that operate on paths and provides several helper methods.
+
+
+
+ The expected path used in the constraint
+
+
+
+ The actual path being tested
+
+
+
+ Flag indicating whether a caseInsensitive comparison should be made
+
+
+
+ Construct a PathConstraint for a give expected path
+
+ The expected path
+
+
+ Modifies the current instance to be case-insensitve
+ and returns it.
+
+
+
+ Modifies the current instance to be case-sensitve
+ and returns it.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Returns true if the expected path and actual path match
+
+
+
+ Returns the string representation of this constraint
+
+
+
+ Canonicalize the provided path
+
+
+ The path in standardized form
+
+
+ Test whether two paths are the same
+
+ The first path
+ The second path
+ Indicates whether case should be ignored
+
+
+
+ Test whether one path is under another path
+
+ The first path - supposed to be the parent path
+ The second path - supposed to be the child path
+ Indicates whether case should be ignored
+
+
+
+ Test whether one path is the same as or under another path
+
+ The first path - supposed to be the parent path
+ The second path - supposed to be the child path
+
+
+
+ Summary description for SamePathConstraint.
+
+
+
+ Initializes a new instance of the class.
+
+ The expected path
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The expected path
+ The actual path
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ SubPathConstraint tests that the actual path is under the expected path
+
+
+
+ Initializes a new instance of the class.
+
+ The expected path
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The expected path
+ The actual path
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ SamePathOrUnderConstraint tests that one path is under another
+
+
+
+ Initializes a new instance of the class.
+
+ The expected path
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The expected path
+ The actual path
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Predicate constraint wraps a Predicate in a constraint,
+ returning success if the predicate is true.
+
+
+
+ Construct a PredicateConstraint from a predicate
+
+
+
+ Determines whether the predicate succeeds when applied
+ to the actual value.
+
+
+
+ Writes the description to a MessageWriter
+
+
+
+ Abstract base class used for prefixes
+
+
+
+ The base constraint
+
+
+
+ Construct given a base constraint
+
+
+
+
+ NotConstraint negates the effect of some other constraint
+
+
+
+ Initializes a new instance of the class.
+
+ The base constraint to be negated.
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for if the base constraint fails, false if it succeeds
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a MessageWriter.
+
+ The writer on which the actual value is displayed
+
+
+ AllItemsConstraint applies another constraint to each
+ item in a collection, succeeding if they all succeed.
+
+
+
+ Construct an AllItemsConstraint on top of an existing constraint
+
+
+
+
+ Apply the item constraint to each item in the collection,
+ failing if any item fails.
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+ SomeItemsConstraint applies another constraint to each
+ item in a collection, succeeding if any of them succeeds.
+
+
+
+ Construct a SomeItemsConstraint on top of an existing constraint
+
+
+
+
+ Apply the item constraint to each item in the collection,
+ succeeding if any item succeeds.
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+ NoItemConstraint applies another constraint to each
+ item in a collection, failing if any of them succeeds.
+
+
+
+ Construct a NoItemConstraint on top of an existing constraint
+
+
+
+
+ Apply the item constraint to each item in the collection,
+ failing if any item fails.
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+ ExactCoutConstraint applies another constraint to each
+ item in a collection, succeeding only if a specified
+ number of items succeed.
+
+
+
+ Construct an ExactCountConstraint on top of an existing constraint
+
+
+
+
+
+ Apply the item constraint to each item in the collection,
+ succeeding only if the expected number of items pass.
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+ PropertyExistsConstraint tests that a named property
+ exists on the object provided through Match.
+ Originally, PropertyConstraint provided this feature
+ in addition to making optional tests on the vaue
+ of the property. The two constraints are now separate.
+
+
+
+ Initializes a new instance of the class.
+
+ The name of the property.
+
+
+ Test whether the property exists for a given object
+
+ The object to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter.
+
+ The writer on which the actual value is displayed
+
+
+ Returns the string representation of the constraint.
+
+
+
+
+ PropertyConstraint extracts a named property and uses
+ its value as the actual value for a chained constraint.
+
+
+
+ Initializes a new instance of the class.
+
+ The name.
+ The constraint to apply to the property.
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+ Returns the string representation of the constraint.
+
+
+
+
+ RangeConstraint tests whethe two values are within a
+ specified range.
+
+
+
+ Initializes a new instance of the class.
+
+ From.
+ To.
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ ResolvableConstraintExpression is used to represent a compound
+ constraint being constructed at a point where the last operator
+ may either terminate the expression or may have additional
+ qualifying constraints added to it.
+ It is used, for example, for a Property element or for
+ an Exception element, either of which may be optionally
+ followed by constraints that apply to the property or
+ exception.
+
+
+
+ Create a new instance of ResolvableConstraintExpression
+
+
+
+ Create a new instance of ResolvableConstraintExpression,
+ passing in a pre-populated ConstraintBuilder.
+
+
+
+ Appends an And Operator to the expression
+
+
+
+ Appends an Or operator to the expression.
+
+
+
+ Resolve the current expression to a Constraint
+
+
+
+ This operator creates a constraint that is satisfied only if both
+ argument constraints are satisfied.
+
+
+
+ This operator creates a constraint that is satisfied only if both
+ argument constraints are satisfied.
+
+
+
+ This operator creates a constraint that is satisfied only if both
+ argument constraints are satisfied.
+
+
+
+ This operator creates a constraint that is satisfied if either
+ of the argument constraints is satisfied.
+
+
+
+ This operator creates a constraint that is satisfied if either
+ of the argument constraints is satisfied.
+
+
+
+ This operator creates a constraint that is satisfied if either
+ of the argument constraints is satisfied.
+
+
+
+ This operator creates a constraint that is satisfied if the
+ argument constraint is not satisfied.
+
+
+
+ ReusableConstraint wraps a resolved constraint so that it
+ may be saved and reused as needed.
+
+
+
+ Construct a ReusableConstraint
+
+ The constraint or expression to be reused
+
+
+ Conversion operator from a normal constraint to a ReusableConstraint.
+
+ The original constraint to be wrapped as a ReusableConstraint
+
+
+
+ Returns the string representation of the constraint.
+
+ A string representing the constraint
+
+
+ Resolves the ReusableConstraint by returning the constraint
+ that it originally wrapped.
+
+ A resolved constraint
+
+
+ SameAsConstraint tests whether an object is identical to
+ the object passed to its constructor
+
+
+
+ Initializes a new instance of the class.
+
+ The expected object.
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ BinarySerializableConstraint tests whether
+ an object is serializable in binary format.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+ Returns the string representation
+
+
+
+ BinarySerializableConstraint tests whether
+ an object is serializable in binary format.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+ Returns the string representation of this constraint
+
+
+
+ StringConstraint is the abstract base for constraints
+ that operate on strings. It supports the IgnoreCase
+ modifier for string operations.
+
+
+
+ The expected value
+
+
+
+ Indicates whether tests should be case-insensitive
+
+
+
+ Constructs a StringConstraint given an expected value
+
+ The expected value
+
+
+ Modify the constraint to ignore case in matching.
+
+
+
+ EmptyStringConstraint tests whether a string is empty.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ NullEmptyStringConstraint tests whether a string is either null or empty.
+
+
+
+ Constructs a new NullOrEmptyStringConstraint
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ SubstringConstraint can test whether a string contains
+ the expected substring.
+
+
+
+ Initializes a new instance of the class.
+
+ The expected.
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ StartsWithConstraint can test whether a string starts
+ with an expected substring.
+
+
+
+ Initializes a new instance of the class.
+
+ The expected string
+
+
+ Test whether the constraint is matched by the actual value.
+ This is a template method, which calls the IsMatch method
+ of the derived class.
+
+
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ EndsWithConstraint can test whether a string ends
+ with an expected substring.
+
+
+
+ Initializes a new instance of the class.
+
+ The expected string
+
+
+ Test whether the constraint is matched by the actual value.
+ This is a template method, which calls the IsMatch method
+ of the derived class.
+
+
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ RegexConstraint can test whether a string matches
+ the pattern provided.
+
+
+
+ Initializes a new instance of the class.
+
+ The pattern.
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ ThrowsConstraint is used to test the exception thrown by
+ a delegate by applying a constraint to it.
+
+
+
+ Initializes a new instance of the class,
+ using a constraint to be applied to the exception.
+
+ A constraint to apply to the caught exception.
+
+
+ Get the actual exception thrown - used by Assert.Throws.
+
+
+
+ Executes the code of the delegate and captures any exception.
+ If a non-null base constraint was provided, it applies that
+ constraint to the exception.
+
+ A delegate representing the code to be tested
+ True if an exception is thrown and the constraint succeeds, otherwise false
+
+
+ Converts an ActualValueDelegate to a TestDelegate
+ before calling the primary overload.
+
+
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+ Returns the string representation of this constraint
+
+
+
+ ThrowsNothingConstraint tests that a delegate does not
+ throw an exception.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True if no exception is thrown, otherwise false
+
+
+ Converts an ActualValueDelegate to a TestDelegate
+ before calling the primary overload.
+
+
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+ Modes in which the tolerance value for a comparison can
+ be interpreted.
+
+
+
+ The tolerance was created with a value, without specifying
+ how the value would be used. This is used to prevent setting
+ the mode more than once and is generally changed to Linear
+ upon execution of the test.
+
+
+
+ The tolerance is used as a numeric range within which
+ two compared values are considered to be equal.
+
+
+
+ Interprets the tolerance as the percentage by which
+ the two compared values my deviate from each other.
+
+
+
+ Compares two values based in their distance in
+ representable numbers.
+
+
+
+ The Tolerance class generalizes the notion of a tolerance
+ within which an equality test succeeds. Normally, it is
+ used with numeric types, but it can be used with any
+ type that supports taking a difference between two
+ objects and comparing that difference to a value.
+
+
+
+ Returns an empty Tolerance object, equivalent to
+ specifying no tolerance. In most cases, it results
+ in an exact match but for floats and doubles a
+ default tolerance may be used.
+
+
+
+ Returns a zero Tolerance object, equivalent to
+ specifying an exact match.
+
+
+
+ Constructs a linear tolerance of a specdified amount
+
+
+
+ Constructs a tolerance given an amount and ToleranceMode
+
+
+
+ Gets the ToleranceMode for the current Tolerance
+
+
+
+ Tests that the current Tolerance is linear with a
+ numeric value, throwing an exception if it is not.
+
+
+
+ Gets the value of the current Tolerance instance.
+
+
+
+ Returns a new tolerance, using the current amount as a percentage.
+
+
+
+ Returns a new tolerance, using the current amount in Ulps.
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of days.
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of hours.
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of minutes.
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of seconds.
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of milliseconds.
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of clock ticks.
+
+
+
+ Returns true if the current tolerance is empty.
+
+
+
+ TypeConstraint is the abstract base for constraints
+ that take a Type as their expected value.
+
+
+
+ The expected Type used by the constraint
+
+
+
+ Construct a TypeConstraint for a given Type
+
+
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. TypeConstraints override this method to write
+ the name of the type.
+
+ The writer on which the actual value is displayed
+
+
+ ExactTypeConstraint is used to test that an object
+ is of the exact type provided in the constructor
+
+
+
+ Construct an ExactTypeConstraint for a given Type
+
+ The expected Type.
+
+
+ Test that an object is of the exact type specified
+
+ The actual value.
+ True if the tested object is of the exact type provided, otherwise false.
+
+
+ Write the description of this constraint to a MessageWriter
+
+ The MessageWriter to use
+
+
+ ExceptionTypeConstraint is a special version of ExactTypeConstraint
+ used to provided detailed info about the exception thrown in
+ an error message.
+
+
+
+ Constructs an ExceptionTypeConstraint
+
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. Overriden to write additional information
+ in the case of an Exception.
+
+ The MessageWriter to use
+
+
+ InstanceOfTypeConstraint is used to test that an object
+ is of the same type provided or derived from it.
+
+
+
+ Construct an InstanceOfTypeConstraint for the type provided
+
+ The expected Type
+
+
+ Test whether an object is of the specified type or a derived type
+
+ The object to be tested
+ True if the object is of the provided type or derives from it, otherwise false.
+
+
+ Write a description of this constraint to a MessageWriter
+
+ The MessageWriter to use
+
+
+ AssignableFromConstraint is used to test that an object
+ can be assigned from a given Type.
+
+
+
+ Construct an AssignableFromConstraint for the type provided
+
+
+
+
+ Test whether an object can be assigned from the specified type
+
+ The object to be tested
+ True if the object can be assigned a value of the expected Type, otherwise false.
+
+
+ Write a description of this constraint to a MessageWriter
+
+ The MessageWriter to use
+
+
+ AssignableToConstraint is used to test that an object
+ can be assigned to a given Type.
+
+
+
+ Construct an AssignableToConstraint for the type provided
+
+
+
+
+ Test whether an object can be assigned to the specified type
+
+ The object to be tested
+ True if the object can be assigned a value of the expected Type, otherwise false.
+
+
+ Write a description of this constraint to a MessageWriter
+
+ The MessageWriter to use
+
+
+ Static helper class used in the constraint-based syntax
+
+
+
+ Creates a new SubstringConstraint
+
+ The value of the substring
+ A SubstringConstraint
+
+
+ Creates a new CollectionContainsConstraint.
+
+ The item that should be found.
+ A new CollectionContainsConstraint
+
+
+ Summary description for DirectoryAssert
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+ We don't actually want any instances of this object, but some people
+ like to inherit from it to add other static methods. Hence, the
+ protected constructor disallows any instances of this object.
+
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+ The message to display if directories are not equal
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+ The message to display if directories are not equal
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+ The message to display if directories are not equal
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+ The message to display if directories are equal
+ Arguments to be used in formatting the message
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+ The message to display if directories are equal
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+ Arguments to be used in formatting the message
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+ Arguments to be used in formatting the message
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+ Arguments to be used in formatting the message
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+ Arguments to be used in formatting the message
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+
+
+ Thrown when an assertion failed.
+
+
+ The error message that explains
+ the reason for the exception
+
+ The error message that explains
+ the reason for the exception
+ The exception that caused the
+ current exception
+
+
+ Serialization Constructor
+
+
+
+ Thrown when an assertion failed.
+
+
+
+
+ The error message that explains
+ the reason for the exception
+ The exception that caused the
+ current exception
+
+
+ Serialization Constructor
+
+
+
+ Thrown when a test executes inconclusively.
+
+
+ The error message that explains
+ the reason for the exception
+
+ The error message that explains
+ the reason for the exception
+ The exception that caused the
+ current exception
+
+
+ Serialization Constructor
+
+
+
+ Thrown when an assertion failed.
+
+
+
+
+ The error message that explains
+ the reason for the exception
+ The exception that caused the
+ current exception
+
+
+ Serialization Constructor
+
+
+
+ Summary description for FileAssert.
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+ We don't actually want any instances of this object, but some people
+ like to inherit from it to add other static methods. Hence, the
+ protected constructor disallows any instances of this object.
+
+
+
+ Verifies that two Streams are equal. Two Streams are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The expected Stream
+ The actual Stream
+ The message to display if Streams are not equal
+ Arguments to be used in formatting the message
+
+
+ Verifies that two Streams are equal. Two Streams are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The expected Stream
+ The actual Stream
+ The message to display if objects are not equal
+
+
+ Verifies that two Streams are equal. Two Streams are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The expected Stream
+ The actual Stream
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+ The message to display if Streams are not equal
+ Arguments to be used in formatting the message
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+ The message to display if objects are not equal
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+ The message to display if Streams are not equal
+ Arguments to be used in formatting the message
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+ The message to display if objects are not equal
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+
+
+ Asserts that two Streams are not equal. If they are equal
+ an is thrown.
+
+ The expected Stream
+ The actual Stream
+ The message to be displayed when the two Stream are the same.
+ Arguments to be used in formatting the message
+
+
+ Asserts that two Streams are not equal. If they are equal
+ an is thrown.
+
+ The expected Stream
+ The actual Stream
+ The message to be displayed when the Streams are the same.
+
+
+ Asserts that two Streams are not equal. If they are equal
+ an is thrown.
+
+ The expected Stream
+ The actual Stream
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+ The message to display if Streams are not equal
+ Arguments to be used in formatting the message
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+ The message to display if objects are not equal
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+ The message to display if Streams are not equal
+ Arguments to be used in formatting the message
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+ The message to display if objects are not equal
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+
+
+ GlobalSettings is a place for setting default values used
+ by the framework in performing asserts.
+
+
+
+ Default tolerance for floating point equality
+
+
+
+ Helper class with properties and methods that supply
+ a number of constraints used in Asserts.
+
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them succeed.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if at least one of them succeeds.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them fail.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding only if a specified number of them succeed.
+
+
+
+ Returns a new PropertyConstraintExpression, which will either
+ test for the existence of the named property on the object
+ being tested or apply any following constraint to that property.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Length property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Count property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Message property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the InnerException property of the object being tested.
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+ Returns a new CollectionContainsConstraint checking for the
+ presence of a particular object in the collection.
+
+
+
+
+
+
+ Compares two objects for equality within a tolerance
+
+ The first object to compare
+ The second object to compare
+ The tolerance to use in the comparison
+
+
+
+
+
+
+
+ Compares two objects of a given Type for equality within a tolerance
+
+ The first object to compare
+ The second object to compare
+ The tolerance to use in the comparison
+
+
+
+ When implemented by an attribute, this interface implemented to provide actions to execute before and after tests.
+
+
+
+ Executed before each test is run
+
+ Provides details about the test that is going to be run.
+
+
+ Executed after each test is run
+
+ Provides details about the test that has just been run.
+
+
+ Provides the target for the action attribute
+
+ The target for the action attribute
+
+
+ Interface implemented by a user fixture in order to
+ validate any expected exceptions. It is only called
+ for test methods marked with the ExpectedException
+ attribute.
+
+
+
+ Method to handle an expected exception
+
+ The exception to be handled
+
+
+ Provides details about a test
+
+
+
+ Creates an instance of TestDetails
+
+ The fixture that the test is a member of, if available.
+ The method that implements the test, if available.
+ The full name of the test.
+ A string representing the type of test, e.g. "Test Case".
+ Indicates if the test represents a suite of tests.
+
+
+ The fixture that the test is a member of, if available.
+
+
+
+ The method that implements the test, if available.
+
+
+
+ The full name of the test.
+
+
+
+ A string representing the type of test, e.g. "Test Case".
+
+
+
+ Indicates if the test represents a suite of tests.
+
+
+
+ Helper class with properties and methods that supply
+ a number of constraints used in Asserts.
+
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them succeed.
+
+
+
+ Returns a constraint that tests for null
+
+
+
+ Returns a constraint that tests for True
+
+
+
+ Returns a constraint that tests for False
+
+
+
+ Returns a constraint that tests for a positive value
+
+
+
+ Returns a constraint that tests for a negative value
+
+
+
+ Returns a constraint that tests for NaN
+
+
+
+ Returns a constraint that tests for empty
+
+
+
+ Returns a constraint that tests whether a collection
+ contains all unique items.
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in binary format.
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in xml format.
+
+
+
+ Returns a constraint that tests two items for equality
+
+
+
+ Returns a constraint that tests that two references are the same object
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a collection containing the same elements as the
+ collection supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a subset of the collection supplied as an argument.
+
+
+
+ Returns a constraint that tests whether a collection is ordered
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the Regex pattern supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same as an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same path or under an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same path or under an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the actual value falls
+ within a specified range.
+
+
+
+ The ITestCaseData interface is implemented by a class
+ that is able to return complete testcases for use by
+ a parameterized test method.
+ NOTE: This interface is used in both the framework
+ and the core, even though that results in two different
+ types. However, sharing the source code guarantees that
+ the various implementations will be compatible and that
+ the core is able to reflect successfully over the
+ framework implementations of ITestCaseData.
+
+
+
+ Gets the argument list to be provided to the test
+
+
+
+ Gets the expected result
+
+
+
+ Indicates whether a result has been specified.
+ This is necessary because the result may be
+ null, so it's value cannot be checked.
+
+
+
+ Gets the expected exception Type
+
+
+
+ Gets the FullName of the expected exception
+
+
+
+ Gets the name to be used for the test
+
+
+
+ Gets the description of the test
+
+
+
+ Gets a value indicating whether this is ignored.
+
+ true if ignored; otherwise, false.
+
+
+ Gets a value indicating whether this is explicit.
+
+ true if explicit; otherwise, false.
+
+
+ Gets the ignore reason.
+
+ The ignore reason.
+
+
+ The Iz class is a synonym for Is intended for use in VB,
+ which regards Is as a keyword.
+
+
+
+ The List class is a helper class with properties and methods
+ that supply a number of constraints used with lists and collections.
+
+
+
+ List.Map returns a ListMapper, which can be used to map
+ the original collection to another collection.
+
+
+
+
+
+ ListMapper is used to transform a collection used as an actual argument
+ producing another collection to be used in the assertion.
+
+
+
+ Construct a ListMapper based on a collection
+
+ The collection to be transformed
+
+
+ Produces a collection containing all the values of a property
+
+ The collection of property values
+
+
+
+ Randomizer returns a set of random values in a repeatable
+ way, to allow re-running of tests if necessary.
+
+
+
+ Get a random seed for use in creating a randomizer.
+
+
+
+ Get a randomizer for a particular member, returning
+ one that has already been created if it exists.
+ This ensures that the same values are generated
+ each time the tests are reloaded.
+
+
+
+ Get a randomizer for a particular parameter, returning
+ one that has already been created if it exists.
+ This ensures that the same values are generated
+ each time the tests are reloaded.
+
+
+
+ Construct a randomizer using a random seed
+
+
+
+ Construct a randomizer using a specified seed
+
+
+
+ Return an array of random doubles between 0.0 and 1.0.
+
+
+
+
+
+ Return an array of random doubles with values in a specified range.
+
+
+
+ Return an array of random ints with values in a specified range.
+
+
+
+ The SpecialValue enum is used to represent TestCase arguments
+ that cannot be used as arguments to an Attribute.
+
+
+
+ Null represents a null value, which cannot be used as an
+ argument to an attriute under .NET 1.x
+
+
+
+ Basic Asserts on strings.
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+ Asserts that a string is found within another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that a string is found within another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+ Asserts that a string is found within another string.
+
+ The expected string
+ The string to be examined
+
+
+ Asserts that a string is not found within another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that a string is found within another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+ Asserts that a string is found within another string.
+
+ The expected string
+ The string to be examined
+
+
+ Asserts that a string starts with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that a string starts with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+ Asserts that a string starts with another string.
+
+ The expected string
+ The string to be examined
+
+
+ Asserts that a string does not start with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that a string does not start with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+ Asserts that a string does not start with another string.
+
+ The expected string
+ The string to be examined
+
+
+ Asserts that a string ends with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that a string ends with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+ Asserts that a string ends with another string.
+
+ The expected string
+ The string to be examined
+
+
+ Asserts that a string does not end with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that a string does not end with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+ Asserts that a string does not end with another string.
+
+ The expected string
+ The string to be examined
+
+
+ Asserts that two strings are equal, without regard to case.
+
+ The expected string
+ The actual string
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that two strings are equal, without regard to case.
+
+ The expected string
+ The actual string
+ The message to display in case of failure
+
+
+ Asserts that two strings are equal, without regard to case.
+
+ The expected string
+ The actual string
+
+
+ Asserts that two strings are not equal, without regard to case.
+
+ The expected string
+ The actual string
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that two strings are Notequal, without regard to case.
+
+ The expected string
+ The actual string
+ The message to display in case of failure
+
+
+ Asserts that two strings are not equal, without regard to case.
+
+ The expected string
+ The actual string
+
+
+ Asserts that a string matches an expected regular expression pattern.
+
+ The regex pattern to be matched
+ The actual string
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that a string matches an expected regular expression pattern.
+
+ The regex pattern to be matched
+ The actual string
+ The message to display in case of failure
+
+
+ Asserts that a string matches an expected regular expression pattern.
+
+ The regex pattern to be matched
+ The actual string
+
+
+ Asserts that a string does not match an expected regular expression pattern.
+
+ The regex pattern to be used
+ The actual string
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that a string does not match an expected regular expression pattern.
+
+ The regex pattern to be used
+ The actual string
+ The message to display in case of failure
+
+
+ Asserts that a string does not match an expected regular expression pattern.
+
+ The regex pattern to be used
+ The actual string
+
+
+ The TestCaseData class represents a set of arguments
+ and other parameter info to be used for a parameterized
+ test case. It provides a number of instance modifiers
+ for use in initializing the test case.
+ Note: Instance modifiers are getters that return
+ the same instance after modifying it's state.
+
+
+
+ The argument list to be provided to the test
+
+
+
+ The expected result to be returned
+
+
+
+ Set to true if this has an expected result
+
+
+
+ The expected exception Type
+
+
+
+ The FullName of the expected exception
+
+
+
+ The name to be used for the test
+
+
+
+ The description of the test
+
+
+
+ A dictionary of properties, used to add information
+ to tests without requiring the class to change.
+
+
+
+ If true, indicates that the test case is to be ignored
+
+
+
+ If true, indicates that the test case is marked explicit
+
+
+
+ The reason for ignoring a test case
+
+
+
+ Initializes a new instance of the class.
+
+ The arguments.
+
+
+ Initializes a new instance of the class.
+
+ The argument.
+
+
+ Initializes a new instance of the class.
+
+ The first argument.
+ The second argument.
+
+
+ Initializes a new instance of the class.
+
+ The first argument.
+ The second argument.
+ The third argument.
+
+
+ Gets the argument list to be provided to the test
+
+
+
+ Gets the expected result
+
+
+
+ Returns true if the result has been set
+
+
+
+ Gets the expected exception Type
+
+
+
+ Gets the FullName of the expected exception
+
+
+
+ Gets the name to be used for the test
+
+
+
+ Gets the description of the test
+
+
+
+ Gets a value indicating whether this is ignored.
+
+ true if ignored; otherwise, false.
+
+
+ Gets a value indicating whether this is explicit.
+
+ true if explicit; otherwise, false.
+
+
+ Gets the ignore reason.
+
+ The ignore reason.
+
+
+ Gets a list of categories associated with this test.
+
+
+
+ Gets the property dictionary for this test
+
+
+
+ Sets the expected result for the test
+
+ The expected result
+ A modified TestCaseData
+
+
+ Sets the expected exception type for the test
+
+ Type of the expected exception.
+ The modified TestCaseData instance
+
+
+ Sets the expected exception type for the test
+
+ FullName of the expected exception.
+ The modified TestCaseData instance
+
+
+ Sets the name of the test case
+
+ The modified TestCaseData instance
+
+
+ Sets the description for the test case
+ being constructed.
+
+ The description.
+ The modified TestCaseData instance.
+
+
+ Applies a category to the test
+
+
+
+
+
+ Applies a named property to the test
+
+
+
+
+
+
+ Applies a named property to the test
+
+
+
+
+
+
+ Applies a named property to the test
+
+
+
+
+
+
+ Ignores this TestCase.
+
+
+
+
+ Ignores this TestCase, specifying the reason.
+
+ The reason.
+
+
+
+ Marks this TestCase as Explicit
+
+
+
+
+ Marks this TestCase as Explicit, specifying the reason.
+
+ The reason.
+
+
+
+ Provide the context information of the current test
+
+
+
+ Constructs a TestContext using the provided context dictionary
+
+ A context dictionary
+
+
+ Get the current test context. This is created
+ as needed. The user may save the context for
+ use within a test, but it should not be used
+ outside the test for which it is created.
+
+
+
+ Gets a TestAdapter representing the currently executing test in this context.
+
+
+
+ Gets a ResultAdapter representing the current result for the test
+ executing in this context.
+
+
+
+ Gets the directory containing the current test assembly.
+
+
+
+ Gets the directory to be used for outputing files created
+ by this test run.
+
+
+
+ TestAdapter adapts a Test for consumption by
+ the user test code.
+
+
+
+ Constructs a TestAdapter for this context
+
+ The context dictionary
+
+
+ The name of the test.
+
+
+
+ The FullName of the test
+
+
+
+ The properties of the test.
+
+
+
+ ResultAdapter adapts a TestResult for consumption by
+ the user test code.
+
+
+
+ Construct a ResultAdapter for a context
+
+ The context holding the result
+
+
+ The TestState of current test. This maps to the ResultState
+ used in nunit.core and is subject to change in the future.
+
+
+
+ The TestStatus of current test. This enum will be used
+ in future versions of NUnit and so is to be preferred
+ to the TestState value.
+
+
+
+ The ResultState enum indicates the result of running a test
+
+
+
+ The result is inconclusive
+
+
+
+ The test was not runnable.
+
+
+
+ The test has been skipped.
+
+
+
+ The test has been ignored.
+
+
+
+ The test succeeded
+
+
+
+ The test failed
+
+
+
+ The test encountered an unexpected exception
+
+
+
+ The test was cancelled by the user
+
+
+
+ The TestStatus enum indicates the result of running a test
+
+
+
+ The test was inconclusive
+
+
+
+ The test has skipped
+
+
+
+ The test succeeded
+
+
+
+ The test failed
+
+
+
+ Helper class with static methods used to supply constraints
+ that operate on strings.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them succeed.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+ Returns a constraint that fails if the actual
+ value contains the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+ Returns a constraint that fails if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+ Returns a constraint that fails if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the Regex pattern supplied as an argument.
+
+
+
+ Returns a constraint that fails if the actual
+ value matches the pattern supplied as an argument.
+
+
+
+ TextMessageWriter writes constraint descriptions and messages
+ in displayable form as a text stream. It tailors the display
+ of individual message components to form the standard message
+ format of NUnit assertion failure messages.
+
+
+
+ Prefix used for the expected value line of a message
+
+
+
+ Prefix used for the actual value line of a message
+
+
+
+ Length of a message prefix
+
+
+
+ Construct a TextMessageWriter
+
+
+
+ Construct a TextMessageWriter, specifying a user message
+ and optional formatting arguments.
+
+
+
+
+
+ Gets or sets the maximum line length for this writer
+
+
+
+ Method to write single line message with optional args, usually
+ written to precede the general failure message, at a givel
+ indentation level.
+
+ The indentation level of the message
+ The message to be written
+ Any arguments used in formatting the message
+
+
+ Display Expected and Actual lines for a constraint. This
+ is called by MessageWriter's default implementation of
+ WriteMessageTo and provides the generic two-line display.
+
+ The constraint that failed
+
+
+ Display Expected and Actual lines for given values. This
+ method may be called by constraints that need more control over
+ the display of actual and expected values than is provided
+ by the default implementation.
+
+ The expected value
+ The actual value causing the failure
+
+
+ Display Expected and Actual lines for given values, including
+ a tolerance value on the expected line.
+
+ The expected value
+ The actual value causing the failure
+ The tolerance within which the test was made
+
+
+ Display the expected and actual string values on separate lines.
+ If the mismatch parameter is >=0, an additional line is displayed
+ line containing a caret that points to the mismatch point.
+
+ The expected string value
+ The actual string value
+ The point at which the strings don't match or -1
+ If true, case is ignored in string comparisons
+ If true, clip the strings to fit the max line length
+
+
+ Writes the text for a connector.
+
+ The connector.
+
+
+ Writes the text for a predicate.
+
+ The predicate.
+
+
+ Write the text for a modifier.
+
+ The modifier.
+
+
+ Writes the text for an expected value.
+
+ The expected value.
+
+
+ Writes the text for an actual value.
+
+ The actual value.
+
+
+ Writes the text for a generalized value.
+
+ The value.
+
+
+ Writes the text for a collection value,
+ starting at a particular point, to a max length
+
+ The collection containing elements to write.
+ The starting point of the elements to write
+ The maximum number of elements to write
+
+
+ Write the generic 'Expected' line for a constraint
+
+ The constraint that failed
+
+
+ Write the generic 'Expected' line for a given value
+
+ The expected value
+
+
+ Write the generic 'Expected' line for a given value
+ and tolerance.
+
+ The expected value
+ The tolerance within which the test was made
+
+
+ Write the generic 'Actual' line for a constraint
+
+ The constraint for which the actual value is to be written
+
+
+ Write the generic 'Actual' line for a given value
+
+ The actual value causing a failure
+
+
+ Helper class with properties and methods that supply
+ constraints that operate on exceptions.
+
+
+
+ Creates a constraint specifying an expected exception
+
+
+
+ Creates a constraint specifying an exception with a given InnerException
+
+
+
+ Creates a constraint specifying an expected TargetInvocationException
+
+
+
+ Creates a constraint specifying an expected TargetInvocationException
+
+
+
+ Creates a constraint specifying an expected TargetInvocationException
+
+
+
+ Creates a constraint specifying that no exception is thrown
+
+
+
+ Creates a constraint specifying the exact type of exception expected
+
+
+
+ Creates a constraint specifying the exact type of exception expected
+
+
+
+ Creates a constraint specifying the type of exception expected
+
+
+
+ Creates a constraint specifying the type of exception expected
+
+
+
diff --git a/frameworks/csharp/nunit/framework/nunit.framework.dll b/frameworks/csharp/nunit/framework/nunit.framework.dll
new file mode 100755
index 00000000..956c32c2
Binary files /dev/null and b/frameworks/csharp/nunit/framework/nunit.framework.dll differ
diff --git a/frameworks/csharp/nunit/framework/nunit.framework.xml b/frameworks/csharp/nunit/framework/nunit.framework.xml
new file mode 100644
index 00000000..bec89757
--- /dev/null
+++ b/frameworks/csharp/nunit/framework/nunit.framework.xml
@@ -0,0 +1,9329 @@
+
+
+
+ nunit.framework
+
+
+
+
+ Delegate used by tests that execute code and
+ capture any thrown exception.
+
+
+
+ The Assert class contains a collection of static methods that
+ implement the most common assertions used in NUnit.
+
+
+
+ We don't actually want any instances of this object, but some people
+ like to inherit from it to add other static methods. Hence, the
+ protected constructor disallows any instances of this object.
+
+
+
+ Gets the number of assertions executed so far and
+ resets the counter to zero.
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+ Helper for Assert.AreEqual(double expected, double actual, ...)
+ allowing code generation to work consistently.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Throws a with the message and arguments
+ that are passed in. This allows a test to be cut short, with a result
+ of success returned to NUnit.
+
+ The message to initialize the with.
+ Arguments to be used in formatting the message
+
+
+ Throws a with the message and arguments
+ that are passed in. This allows a test to be cut short, with a result
+ of success returned to NUnit.
+
+ The message to initialize the with.
+
+
+ Throws a with the message and arguments
+ that are passed in. This allows a test to be cut short, with a result
+ of success returned to NUnit.
+
+
+
+ Throws an with the message and arguments
+ that are passed in. This is used by the other Assert functions.
+
+ The message to initialize the with.
+ Arguments to be used in formatting the message
+
+
+ Throws an with the message that is
+ passed in. This is used by the other Assert functions.
+
+ The message to initialize the with.
+
+
+ Throws an .
+ This is used by the other Assert functions.
+
+
+
+ Throws an with the message and arguments
+ that are passed in. This causes the test to be reported as ignored.
+
+ The message to initialize the with.
+ Arguments to be used in formatting the message
+
+
+ Throws an with the message that is
+ passed in. This causes the test to be reported as ignored.
+
+ The message to initialize the with.
+
+
+ Throws an .
+ This causes the test to be reported as ignored.
+
+
+
+ Throws an with the message and arguments
+ that are passed in. This causes the test to be reported as inconclusive.
+
+ The message to initialize the with.
+ Arguments to be used in formatting the message
+
+
+ Throws an with the message that is
+ passed in. This causes the test to be reported as inconclusive.
+
+ The message to initialize the with.
+
+
+ Throws an .
+ This causes the test to be reported as Inconclusive.
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint to be applied
+ The actual value to test
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint to be applied
+ The actual value to test
+ The message that will be displayed on failure
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint expression to be applied
+ An ActualValueDelegate returning the value to be tested
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint expression to be applied
+ An ActualValueDelegate returning the value to be tested
+ The message that will be displayed on failure
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ An ActualValueDelegate returning the value to be tested
+ A Constraint expression to be applied
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint to be applied
+ The actual value to test
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint to be applied
+ The actual value to test
+ The message that will be displayed on failure
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint to be applied
+ The actual value to test
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display if the condition is false
+ Arguments to be used in formatting the message
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display if the condition is false
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+
+
+ Asserts that the code represented by a delegate throws an exception
+ that satisfies the constraint provided.
+
+ A TestDelegate to be executed
+ A ThrowsConstraint used in the test
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+ Used as a synonym for That in rare cases where a private setter
+ causes a Visual Basic compilation error.
+
+ A Constraint to be applied
+ The actual value to test
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+ Used as a synonym for That in rare cases where a private setter
+ causes a Visual Basic compilation error.
+
+ A Constraint to be applied
+ The actual value to test
+ The message that will be displayed on failure
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+ Used as a synonym for That in rare cases where a private setter
+ causes a Visual Basic compilation error.
+
+
+ This method is provided for use by VB developers needing to test
+ the value of properties with private setters.
+
+ A Constraint expression to be applied
+ The actual value to test
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ A constraint to be satisfied by the exception
+ A TestSnippet delegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ A constraint to be satisfied by the exception
+ A TestSnippet delegate
+ The message that will be displayed on failure
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ A constraint to be satisfied by the exception
+ A TestSnippet delegate
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ The exception Type expected
+ A TestSnippet delegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ The exception Type expected
+ A TestSnippet delegate
+ The message that will be displayed on failure
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ The exception Type expected
+ A TestSnippet delegate
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ Type of the expected exception
+ A TestSnippet delegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ Type of the expected exception
+ A TestSnippet delegate
+ The message that will be displayed on failure
+
+
+ Verifies that a delegate throws a particular exception when called.
+
+ Type of the expected exception
+ A TestSnippet delegate
+
+
+ Verifies that a delegate throws an exception when called
+ and returns it.
+
+ A TestDelegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Verifies that a delegate throws an exception when called
+ and returns it.
+
+ A TestDelegate
+ The message that will be displayed on failure
+
+
+ Verifies that a delegate throws an exception when called
+ and returns it.
+
+ A TestDelegate
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+ The message that will be displayed on failure
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+ The message that will be displayed on failure
+
+
+ Verifies that a delegate throws an exception of a certain Type
+ or one derived from it when called and returns it.
+
+ The expected Exception Type
+ A TestDelegate
+
+
+ Verifies that a delegate does not throw an exception
+
+ A TestSnippet delegate
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Verifies that a delegate does not throw an exception.
+
+ A TestSnippet delegate
+ The message that will be displayed on failure
+
+
+ Verifies that a delegate does not throw an exception.
+
+ A TestSnippet delegate
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+ The message to display in case of failure
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null
then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null
then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null
then an
+ is thrown.
+
+ The object that is to be tested
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null
then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null
then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null
then an
+ is thrown.
+
+ The object that is to be tested
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null
then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null
then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null
then an
+ is thrown.
+
+ The object that is to be tested
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null
then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null
then an
+ is thrown.
+
+ The object that is to be tested
+ The message to display in case of failure
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is not null
then an
+ is thrown.
+
+ The object that is to be tested
+
+
+ Verifies that the double that is passed in is an NaN
value.
+ If the object is not NaN
then an
+ is thrown.
+
+ The value that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the double that is passed in is an NaN
value.
+ If the object is not NaN
then an
+ is thrown.
+
+ The value that is to be tested
+ The message to display in case of failure
+
+
+ Verifies that the double that is passed in is an NaN
value.
+ If the object is not NaN
then an
+ is thrown.
+
+ The value that is to be tested
+
+
+ Verifies that the double that is passed in is an NaN
value.
+ If the object is not NaN
then an
+ is thrown.
+
+ The value that is to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the double that is passed in is an NaN
value.
+ If the object is not NaN
then an
+ is thrown.
+
+ The value that is to be tested
+ The message to display in case of failure
+
+
+ Verifies that the double that is passed in is an NaN
value.
+ If the object is not NaN
then an
+ is thrown.
+
+ The value that is to be tested
+
+
+ Assert that a string is empty - that is equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Assert that a string is empty - that is equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+
+
+ Assert that a string is empty - that is equal to string.Empty
+
+ The string to be tested
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing ICollection
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing ICollection
+ The message to display in case of failure
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing ICollection
+
+
+ Assert that a string is not empty - that is not equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Assert that a string is not empty - that is not equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+
+
+ Assert that a string is not empty - that is not equal to string.Empty
+
+ The string to be tested
+
+
+ Assert that an array, list or other collection is not empty
+
+ An array, list or other collection implementing ICollection
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Assert that an array, list or other collection is not empty
+
+ An array, list or other collection implementing ICollection
+ The message to display in case of failure
+
+
+ Assert that an array, list or other collection is not empty
+
+ An array, list or other collection implementing ICollection
+
+
+ Assert that a string is either null or equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Assert that a string is either null or equal to string.Empty
+
+ The string to be tested
+ The message to display in case of failure
+
+
+ Assert that a string is either null or equal to string.Empty
+
+ The string to be tested
+
+
+ Assert that a string is not null or empty
+
+ The string to be tested
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Assert that a string is not null or empty
+
+ The string to be tested
+ The message to display in case of failure
+
+
+ Assert that a string is not null or empty
+
+ The string to be tested
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+
+
+ Asserts that an object may be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+ The message to display in case of failure
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+ The message to display in case of failure
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type
+ The object being examined
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are equal. If they are not, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+ The message to display in case of failure
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+ The message to display in case of failure
+
+
+ Verifies that two doubles are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equal then an is
+ thrown.
+
+ The expected value
+ The actual value
+ The maximum acceptable difference between the
+ the expected and the actual
+
+
+ Verifies that two objects are equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are not equal an is thrown.
+
+ The value that is expected
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two objects are equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are not equal an is thrown.
+
+ The value that is expected
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two objects are equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are not equal an is thrown.
+
+ The value that is expected
+ The actual value
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two values are not equal. If they are equal, then an
+ is thrown.
+
+ The expected value
+ The actual value
+
+
+ Verifies that two objects are not equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are equal an is thrown.
+
+ The value that is expected
+ The actual value
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that two objects are not equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are equal an is thrown.
+
+ The value that is expected
+ The actual value
+ The message to display in case of failure
+
+
+ Verifies that two objects are not equal. Two objects are considered
+ equal if both are null, or if both have the same value. NUnit
+ has special semantics for some object types.
+ If they are equal an is thrown.
+
+ The value that is expected
+ The actual value
+
+
+ Asserts that two objects refer to the same object. If they
+ are not the same an is thrown.
+
+ The expected object
+ The actual object
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that two objects refer to the same object. If they
+ are not the same an is thrown.
+
+ The expected object
+ The actual object
+ The message to display in case of failure
+
+
+ Asserts that two objects refer to the same object. If they
+ are not the same an is thrown.
+
+ The expected object
+ The actual object
+
+
+ Asserts that two objects do not refer to the same object. If they
+ are the same an is thrown.
+
+ The expected object
+ The actual object
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that two objects do not refer to the same object. If they
+ are the same an is thrown.
+
+ The expected object
+ The actual object
+ The message to display in case of failure
+
+
+ Asserts that two objects do not refer to the same object. If they
+ are the same an is thrown.
+
+ The expected object
+ The actual object
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+ The message to display in case of failure
+
+
+ Verifies that the first value is greater than or equal tothe second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be greater
+ The second value, expected to be less
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+ The message to display in case of failure
+
+
+ Verifies that the first value is less than or equal to the second
+ value. If it is not, then an
+ is thrown.
+
+ The first value, expected to be less
+ The second value, expected to be greater
+
+
+ Asserts that an object is contained in a list.
+
+ The expected object
+ The list to be examined
+ The message to display in case of failure
+ Array of objects to be used in formatting the message
+
+
+ Asserts that an object is contained in a list.
+
+ The expected object
+ The list to be examined
+ The message to display in case of failure
+
+
+ Asserts that an object is contained in a list.
+
+ The expected object
+ The list to be examined
+
+
+ AssertionHelper is an optional base class for user tests,
+ allowing the use of shorter names for constraints and
+ asserts and avoiding conflict with the definition of
+ , from which it inherits much of its
+ behavior, in certain mock object frameworks.
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure. Works
+ identically to Assert.That
+
+ A Constraint to be applied
+ The actual value to test
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure. Works
+ identically to Assert.That.
+
+ A Constraint to be applied
+ The actual value to test
+ The message that will be displayed on failure
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure. Works
+ identically to Assert.That
+
+ A Constraint to be applied
+ The actual value to test
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint expression to be applied
+ An ActualValueDelegate returning the value to be tested
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint expression to be applied
+ An ActualValueDelegate returning the value to be tested
+ The message that will be displayed on failure
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ An ActualValueDelegate returning the value to be tested
+ A Constraint expression to be applied
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint to be applied
+ The actual value to test
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint to be applied
+ The actual value to test
+ The message that will be displayed on failure
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an assertion exception on failure.
+
+ A Constraint to be applied
+ The actual value to test
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an . Works Identically to Assert.That.
+
+ The evaluated condition
+ The message to display if the condition is false
+ Arguments to be used in formatting the message
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an . Works Identically to Assert.That.
+
+ The evaluated condition
+ The message to display if the condition is false
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an . Works Identically Assert.That.
+
+ The evaluated condition
+
+
+ Asserts that the code represented by a delegate throws an exception
+ that satisfies the constraint provided.
+
+ A TestDelegate to be executed
+ A ThrowsConstraint used in the test
+
+
+ Returns a ListMapper based on a collection.
+
+ The original collection
+
+
+
+ Provides static methods to express the assumptions
+ that must be met for a test to give a meaningful
+ result. If an assumption is not met, the test
+ should produce an inconclusive result.
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+ The message that will be displayed on failure
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ An ActualValueDelegate returning the value to be tested
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ An ActualValueDelegate returning the value to be tested
+ The message that will be displayed on failure
+
+
+ Apply a constraint to an actual value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ An ActualValueDelegate returning the value to be tested
+ A Constraint expression to be applied
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+ The message that will be displayed on failure
+
+
+ Apply a constraint to a referenced value, succeeding if the constraint
+ is satisfied and throwing an InconclusiveException on failure.
+
+ A Constraint expression to be applied
+ The actual value to test
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display if the condition is false
+ Arguments to be used in formatting the message
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition
+ The message to display if the condition is false
+
+
+ Asserts that a condition is true. If the condition is false the
+ method throws an .
+
+ The evaluated condition
+
+
+ Asserts that the code represented by a delegate throws an exception
+ that satisfies the constraint provided.
+
+ A TestDelegate to be executed
+ A ThrowsConstraint used in the test
+
+
+ The different targets a test action attribute can be applied to
+
+
+
+ Default target, which is determined by where the action attribute is attached
+
+
+
+ Target a individual test case
+
+
+
+ Target a suite of test cases
+
+
+
+ Attribute used to apply a category to a test
+
+
+
+ The name of the category
+
+
+
+ Construct attribute for a given category based on
+ a name. The name may not contain the characters ',',
+ '+', '-' or '!'. However, this is not checked in the
+ constructor since it would cause an error to arise at
+ as the test was loaded without giving a clear indication
+ of where the problem is located. The error is handled
+ in NUnitFramework.cs by marking the test as not
+ runnable.
+
+ The name of the category
+
+
+ Protected constructor uses the Type name as the name
+ of the category.
+
+
+
+ The name of the category
+
+
+
+ Used to mark a field for use as a datapoint when executing a theory
+ within the same fixture that requires an argument of the field's Type.
+
+
+
+ Used to mark an array as containing a set of datapoints to be used
+ executing a theory within the same fixture that requires an argument
+ of the Type of the array elements.
+
+
+
+ Attribute used to provide descriptive text about a
+ test case or fixture.
+
+
+
+ Construct the attribute
+
+ Text describing the test
+
+
+ Gets the test description
+
+
+
+ Enumeration indicating how the expected message parameter is to be used
+
+
+ Expect an exact match
+
+ Expect a message containing the parameter string
+
+ Match the regular expression provided as a parameter
+
+ Expect a message that starts with the parameter string
+
+
+ ExpectedExceptionAttribute
+
+
+
+ Constructor for a non-specific exception
+
+
+
+ Constructor for a given type of exception
+
+ The type of the expected exception
+
+
+ Constructor for a given exception name
+
+ The full name of the expected exception
+
+
+ Gets or sets the expected exception type
+
+
+
+ Gets or sets the full Type name of the expected exception
+
+
+
+ Gets or sets the expected message text
+
+
+
+ Gets or sets the user message displayed in case of failure
+
+
+
+ Gets or sets the type of match to be performed on the expected message
+
+
+
+ Gets the name of a method to be used as an exception handler
+
+
+
+ ExplicitAttribute marks a test or test fixture so that it will
+ only be run if explicitly executed from the gui or command line
+ or if it is included by use of a filter. The test will not be
+ run simply because an enclosing suite is run.
+
+
+
+ Default constructor
+
+
+
+ Constructor with a reason
+
+ The reason test is marked explicit
+
+
+ The reason test is marked explicit
+
+
+
+ Attribute used to mark a test that is to be ignored.
+ Ignored tests result in a warning message when the
+ tests are run.
+
+
+
+ Constructs the attribute without giving a reason
+ for ignoring the test.
+
+
+
+ Constructs the attribute giving a reason for ignoring the test
+
+ The reason for ignoring the test
+
+
+ The reason for ignoring a test
+
+
+
+ Abstract base for Attributes that are used to include tests
+ in the test run based on environmental settings.
+
+
+
+ Constructor with no included items specified, for use
+ with named property syntax.
+
+
+
+ Constructor taking one or more included items
+
+ Comma-delimited list of included items
+
+
+ Name of the item that is needed in order for
+ a test to run. Multiple itemss may be given,
+ separated by a comma.
+
+
+
+ Name of the item to be excluded. Multiple items
+ may be given, separated by a comma.
+
+
+
+ The reason for including or excluding the test
+
+
+
+ PlatformAttribute is used to mark a test fixture or an
+ individual method as applying to a particular platform only.
+
+
+
+ Constructor with no platforms specified, for use
+ with named property syntax.
+
+
+
+ Constructor taking one or more platforms
+
+ Comma-deliminted list of platforms
+
+
+ CultureAttribute is used to mark a test fixture or an
+ individual method as applying to a particular Culture only.
+
+
+
+ Constructor with no cultures specified, for use
+ with named property syntax.
+
+
+
+ Constructor taking one or more cultures
+
+ Comma-deliminted list of cultures
+
+
+ Marks a test to use a combinatorial join of any argument data
+ provided. NUnit will create a test case for every combination of
+ the arguments provided. This can result in a large number of test
+ cases and so should be used judiciously. This is the default join
+ type, so the attribute need not be used except as documentation.
+
+
+
+ Default constructor
+
+
+
+ Marks a test to use pairwise join of any argument data provided.
+ NUnit will attempt too excercise every pair of argument values at
+ least once, using as small a number of test cases as it can. With
+ only two arguments, this is the same as a combinatorial join.
+
+
+
+ Default constructor
+
+
+
+ Marks a test to use a sequential join of any argument data
+ provided. NUnit will use arguements for each parameter in
+ sequence, generating test cases up to the largest number
+ of argument values provided and using null for any arguments
+ for which it runs out of values. Normally, this should be
+ used with the same number of arguments for each parameter.
+
+
+
+ Default constructor
+
+
+
+ Summary description for MaxTimeAttribute.
+
+
+
+ Construct a MaxTimeAttribute, given a time in milliseconds.
+
+ The maximum elapsed time in milliseconds
+
+
+ PropertyAttribute is used to attach information to a test as a name/value pair..
+
+
+
+ Construct a PropertyAttribute with a name and string value
+
+ The name of the property
+ The property value
+
+
+ Construct a PropertyAttribute with a name and int value
+
+ The name of the property
+ The property value
+
+
+ Construct a PropertyAttribute with a name and double value
+
+ The name of the property
+ The property value
+
+
+ Constructor for derived classes that set the
+ property dictionary directly.
+
+
+
+ Constructor for use by derived classes that use the
+ name of the type as the property name. Derived classes
+ must ensure that the Type of the property value is
+ a standard type supported by the BCL. Any custom
+ types will cause a serialization Exception when
+ in the client.
+
+
+
+ Gets the property dictionary for this attribute
+
+
+
+ RandomAttribute is used to supply a set of random values
+ to a single parameter of a parameterized test.
+
+
+
+ Construct a set of doubles from 0.0 to 1.0,
+ specifying only the count.
+
+
+
+
+ Construct a set of doubles from min to max
+
+
+
+
+
+
+ Construct a set of ints from min to max
+
+
+
+
+
+
+ Get the collection of values to be used as arguments
+
+
+
+ RangeAttribute is used to supply a range of values to an
+ individual parameter of a parameterized test.
+
+
+
+ Construct a range of ints using default step of 1
+
+
+
+
+
+ Construct a range of ints specifying the step size
+
+
+
+
+
+
+ Construct a range of longs
+
+
+
+
+
+
+ Construct a range of doubles
+
+
+
+
+
+
+ Construct a range of floats
+
+
+
+
+
+
+ RepeatAttribute may be applied to test case in order
+ to run it multiple times.
+
+
+
+ Construct a RepeatAttribute
+
+ The number of times to run the test
+
+
+ RequiredAddinAttribute may be used to indicate the names of any addins
+ that must be present in order to run some or all of the tests in an
+ assembly. If the addin is not loaded, the entire assembly is marked
+ as NotRunnable.
+
+
+
+ Initializes a new instance of the class.
+
+ The required addin.
+
+
+ Gets the name of required addin.
+
+ The required addin name.
+
+
+ Summary description for SetCultureAttribute.
+
+
+
+ Construct given the name of a culture
+
+
+
+
+ Summary description for SetUICultureAttribute.
+
+
+
+ Construct given the name of a culture
+
+
+
+
+ SetUpAttribute is used in a TestFixture to identify a method
+ that is called immediately before each test is run. It is
+ also used in a SetUpFixture to identify the method that is
+ called once, before any of the subordinate tests are run.
+
+
+
+ Attribute used to mark a class that contains one-time SetUp
+ and/or TearDown methods that apply to all the tests in a
+ namespace or an assembly.
+
+
+
+ Attribute used to mark a static (shared in VB) property
+ that returns a list of tests.
+
+
+
+ Attribute used in a TestFixture to identify a method that is
+ called immediately after each test is run. It is also used
+ in a SetUpFixture to identify the method that is called once,
+ after all subordinate tests have run. In either case, the method
+ is guaranteed to be called, even if an exception is thrown.
+
+
+
+ Provide actions to execute before and after tests.
+
+
+
+ Adding this attribute to a method within a
+ class makes the method callable from the NUnit test runner. There is a property
+ called Description which is optional which you can provide a more detailed test
+ description. This class cannot be inherited.
+
+
+ [TestFixture]
+ public class Fixture
+ {
+ [Test]
+ public void MethodToTest()
+ {}
+ [Test(Description = "more detailed description")]
+ publc void TestDescriptionMethod()
+ {}
+ }
+
+
+
+ Descriptive text for this test
+
+
+
+ TestCaseAttribute is used to mark parameterized test cases
+ and provide them with their arguments.
+
+
+
+ Construct a TestCaseAttribute with a list of arguments.
+ This constructor is not CLS-Compliant
+
+
+
+
+ Construct a TestCaseAttribute with a single argument
+
+
+
+
+ Construct a TestCaseAttribute with a two arguments
+
+
+
+
+
+ Construct a TestCaseAttribute with a three arguments
+
+
+
+
+
+
+ Gets the list of arguments to a test case
+
+
+
+ Gets or sets the expected result. Use
+ ExpectedResult by preference.
+
+ The result.
+
+
+ Gets or sets the expected result.
+
+ The result.
+
+
+ Gets a flag indicating whether an expected
+ result has been set.
+
+
+
+ Gets a list of categories associated with this test;
+
+
+
+ Gets or sets the category associated with this test.
+ May be a single category or a comma-separated list.
+
+
+
+ Gets or sets the expected exception.
+
+ The expected exception.
+
+
+ Gets or sets the name the expected exception.
+
+ The expected name of the exception.
+
+
+ Gets or sets the expected message of the expected exception
+
+ The expected message of the exception.
+
+
+ Gets or sets the type of match to be performed on the expected message
+
+
+
+ Gets or sets the description.
+
+ The description.
+
+
+ Gets or sets the name of the test.
+
+ The name of the test.
+
+
+ Gets or sets the ignored status of the test
+
+
+
+ Gets or sets the ignored status of the test
+
+
+
+ Gets or sets the explicit status of the test
+
+
+
+ Gets or sets the reason for not running the test
+
+
+
+ Gets or sets the reason for not running the test.
+ Set has the side effect of marking the test as ignored.
+
+ The ignore reason.
+
+
+ FactoryAttribute indicates the source to be used to
+ provide test cases for a test method.
+
+
+
+ Construct with the name of the data source, which must
+ be a property, field or method of the test class itself.
+
+ An array of the names of the factories that will provide data
+
+
+ Construct with a Type, which must implement IEnumerable
+
+ The Type that will provide data
+
+
+ Construct with a Type and name.
+ that don't support params arrays.
+
+ The Type that will provide data
+ The name of the method, property or field that will provide data
+
+
+ The name of a the method, property or fiend to be used as a source
+
+
+
+ A Type to be used as a source
+
+
+
+ Gets or sets the category associated with this test.
+ May be a single category or a comma-separated list.
+
+
+
+ [TestFixture]
+ public class ExampleClass
+ {}
+
+
+
+ Default constructor
+
+
+
+ Construct with a object[] representing a set of arguments.
+ In .NET 2.0, the arguments may later be separated into
+ type arguments and constructor arguments.
+
+
+
+
+ Descriptive text for this fixture
+
+
+
+ Gets and sets the category for this fixture.
+ May be a comma-separated list of categories.
+
+
+
+ Gets a list of categories for this fixture
+
+
+
+ The arguments originally provided to the attribute
+
+
+
+ Gets or sets a value indicating whether this should be ignored.
+
+ true if ignore; otherwise, false.
+
+
+ Gets or sets the ignore reason. May set Ignored as a side effect.
+
+ The ignore reason.
+
+
+ Get or set the type arguments. If not set
+ explicitly, any leading arguments that are
+ Types are taken as type arguments.
+
+
+
+ Attribute used to identify a method that is
+ called before any tests in a fixture are run.
+
+
+
+ Attribute used to identify a method that is called after
+ all the tests in a fixture have run. The method is
+ guaranteed to be called, even if an exception is thrown.
+
+
+
+ Adding this attribute to a method within a
+ class makes the method callable from the NUnit test runner. There is a property
+ called Description which is optional which you can provide a more detailed test
+ description. This class cannot be inherited.
+
+
+ [TestFixture]
+ public class Fixture
+ {
+ [Test]
+ public void MethodToTest()
+ {}
+ [Test(Description = "more detailed description")]
+ publc void TestDescriptionMethod()
+ {}
+ }
+
+
+
+ Used on a method, marks the test with a timeout value in milliseconds.
+ The test will be run in a separate thread and is cancelled if the timeout
+ is exceeded. Used on a method or assembly, sets the default timeout
+ for all contained test methods.
+
+
+
+ Construct a TimeoutAttribute given a time in milliseconds
+
+ The timeout value in milliseconds
+
+
+ Marks a test that must run in the STA, causing it
+ to run in a separate thread if necessary.
+ On methods, you may also use STAThreadAttribute
+ to serve the same purpose.
+
+
+
+ Construct a RequiresSTAAttribute
+
+
+
+ Marks a test that must run in the MTA, causing it
+ to run in a separate thread if necessary.
+ On methods, you may also use MTAThreadAttribute
+ to serve the same purpose.
+
+
+
+ Construct a RequiresMTAAttribute
+
+
+
+ Marks a test that must run on a separate thread.
+
+
+
+ Construct a RequiresThreadAttribute
+
+
+
+ Construct a RequiresThreadAttribute, specifying the apartment
+
+
+
+ Abstract base class for attributes that apply to parameters
+ and supply data for the parameter.
+
+
+
+ Gets the data to be provided to the specified parameter
+
+
+
+ ValuesAttribute is used to provide literal arguments for
+ an individual parameter of a test.
+
+
+
+ The collection of data to be returned. Must
+ be set by any derived attribute classes.
+ We use an object[] so that the individual
+ elements may have their type changed in GetData
+ if necessary.
+
+
+
+ Construct with one argument
+
+
+
+
+ Construct with two arguments
+
+
+
+
+
+ Construct with three arguments
+
+
+
+
+
+
+ Construct with an array of arguments
+
+
+
+
+ Get the collection of values to be used as arguments
+
+
+
+ ValueSourceAttribute indicates the source to be used to
+ provide data for one parameter of a test method.
+
+
+
+ Construct with the name of the factory - for use with languages
+ that don't support params arrays.
+
+ The name of the data source to be used
+
+
+ Construct with a Type and name - for use with languages
+ that don't support params arrays.
+
+ The Type that will provide data
+ The name of the method, property or field that will provide data
+
+
+ The name of a the method, property or fiend to be used as a source
+
+
+
+ A Type to be used as a source
+
+
+
+ A set of Assert methods operationg on one or more collections
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+ Asserts that all items contained in collection are of the type specified by expectedType.
+
+ IEnumerable containing objects to be considered
+ System.Type that all objects in collection must be instances of
+
+
+ Asserts that all items contained in collection are of the type specified by expectedType.
+
+ IEnumerable containing objects to be considered
+ System.Type that all objects in collection must be instances of
+ The message that will be displayed on failure
+
+
+ Asserts that all items contained in collection are of the type specified by expectedType.
+
+ IEnumerable containing objects to be considered
+ System.Type that all objects in collection must be instances of
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that all items contained in collection are not equal to null.
+
+ IEnumerable containing objects to be considered
+
+
+ Asserts that all items contained in collection are not equal to null.
+
+ IEnumerable containing objects to be considered
+ The message that will be displayed on failure
+
+
+ Asserts that all items contained in collection are not equal to null.
+
+ IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Ensures that every object contained in collection exists within the collection
+ once and only once.
+
+ IEnumerable of objects to be considered
+
+
+ Ensures that every object contained in collection exists within the collection
+ once and only once.
+
+ IEnumerable of objects to be considered
+ The message that will be displayed on failure
+
+
+ Ensures that every object contained in collection exists within the collection
+ once and only once.
+
+ IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+ The message that will be displayed on failure
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that expected and actual are exactly equal. The collections must have the same count,
+ and contain the exact same objects in the same order.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+
+
+ Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+
+
+ Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that expected and actual are not exactly equal.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+
+
+ Asserts that expected and actual are not exactly equal.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+
+
+ Asserts that expected and actual are not exactly equal.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+
+
+ Asserts that expected and actual are not exactly equal.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+ The message that will be displayed on failure
+
+
+ Asserts that expected and actual are not exactly equal.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that expected and actual are not exactly equal.
+ If comparer is not null then it will be used to compare the objects.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The IComparer to use in comparing objects from each IEnumerable
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that expected and actual are not equivalent.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+
+
+ Asserts that expected and actual are not equivalent.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+
+
+ Asserts that expected and actual are not equivalent.
+
+ The first IEnumerable of objects to be considered
+ The second IEnumerable of objects to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that collection contains actual as an item.
+
+ IEnumerable of objects to be considered
+ Object to be found within collection
+
+
+ Asserts that collection contains actual as an item.
+
+ IEnumerable of objects to be considered
+ Object to be found within collection
+ The message that will be displayed on failure
+
+
+ Asserts that collection contains actual as an item.
+
+ IEnumerable of objects to be considered
+ Object to be found within collection
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that collection does not contain actual as an item.
+
+ IEnumerable of objects to be considered
+ Object that cannot exist within collection
+
+
+ Asserts that collection does not contain actual as an item.
+
+ IEnumerable of objects to be considered
+ Object that cannot exist within collection
+ The message that will be displayed on failure
+
+
+ Asserts that collection does not contain actual as an item.
+
+ IEnumerable of objects to be considered
+ Object that cannot exist within collection
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that superset is not a subject of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+
+
+ Asserts that superset is not a subject of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+ The message that will be displayed on failure
+
+
+ Asserts that superset is not a subject of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Asserts that superset is a subset of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+
+
+ Asserts that superset is a subset of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+ The message that will be displayed on failure
+
+
+ Asserts that superset is a subset of subset.
+
+ The IEnumerable superset to be considered
+ The IEnumerable subset to be considered
+ The message that will be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+
+
+ Assert that an array,list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+
+
+ Assert that an array,list or other collection is empty
+
+ An array, list or other collection implementing IEnumerable
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+ The message to be displayed on failure
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+ A custom comparer to perform the comparisons
+ The message to be displayed on failure
+ Arguments to be used in formatting the message
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+ A custom comparer to perform the comparisons
+ The message to be displayed on failure
+
+
+ Assert that an array, list or other collection is ordered
+
+ An array, list or other collection implementing IEnumerable
+ A custom comparer to perform the comparisons
+
+
+ AttributeExistsConstraint tests for the presence of a
+ specified attribute on a Type.
+
+
+
+ Constructs an AttributeExistsConstraint for a specific attribute Type
+
+
+
+
+ Tests whether the object provides the expected attribute.
+
+ A Type, MethodInfo, or other ICustomAttributeProvider
+ True if the expected attribute is present, otherwise false
+
+
+ Writes the description of the constraint to the specified writer
+
+
+
+ AttributeConstraint tests that a specified attribute is present
+ on a Type or other provider and that the value of the attribute
+ satisfies some other constraint.
+
+
+
+ Constructs an AttributeConstraint for a specified attriute
+ Type and base constraint.
+
+
+
+
+
+ Determines whether the Type or other provider has the
+ expected attribute and if its value matches the
+ additional constraint specified.
+
+
+
+ Writes a description of the attribute to the specified writer.
+
+
+
+ Writes the actual value supplied to the specified writer.
+
+
+
+ Returns a string representation of the constraint.
+
+
+
+ BasicConstraint is the abstract base for constraints that
+ perform a simple comparison to a constant value.
+
+
+
+ Initializes a new instance of the class.
+
+ The expected.
+ The description.
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ NullConstraint tests that the actual value is null
+
+
+
+ Initializes a new instance of the class.
+
+
+
+ TrueConstraint tests that the actual value is true
+
+
+
+ Initializes a new instance of the class.
+
+
+
+ FalseConstraint tests that the actual value is false
+
+
+
+ Initializes a new instance of the class.
+
+
+
+ NaNConstraint tests that the actual value is a double or float NaN
+
+
+
+ Test that the actual value is an NaN
+
+
+
+
+
+ Write the constraint description to a specified writer
+
+
+
+
+ BinaryConstraint is the abstract base of all constraints
+ that combine two other constraints in some fashion.
+
+
+
+ The first constraint being combined
+
+
+
+ The second constraint being combined
+
+
+
+ Construct a BinaryConstraint from two other constraints
+
+ The first constraint
+ The second constraint
+
+
+ AndConstraint succeeds only if both members succeed.
+
+
+
+ Create an AndConstraint from two other constraints
+
+ The first constraint
+ The second constraint
+
+
+ Apply both member constraints to an actual value, succeeding
+ succeeding only if both of them succeed.
+
+ The actual value
+ True if the constraints both succeeded
+
+
+ Write a description for this contraint to a MessageWriter
+
+ The MessageWriter to receive the description
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+ OrConstraint succeeds if either member succeeds
+
+
+
+ Create an OrConstraint from two other constraints
+
+ The first constraint
+ The second constraint
+
+
+ Apply the member constraints to an actual value, succeeding
+ succeeding as soon as one of them succeeds.
+
+ The actual value
+ True if either constraint succeeded
+
+
+ Write a description for this contraint to a MessageWriter
+
+ The MessageWriter to receive the description
+
+
+ CollectionConstraint is the abstract base class for
+ constraints that operate on collections.
+
+
+
+ Construct an empty CollectionConstraint
+
+
+
+ Construct a CollectionConstraint
+
+
+
+
+ Determines whether the specified enumerable is empty.
+
+ The enumerable.
+
+ true if the specified enumerable is empty; otherwise, false.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Protected method to be implemented by derived classes
+
+
+
+
+
+ CollectionItemsEqualConstraint is the abstract base class for all
+ collection constraints that apply some notion of item equality
+ as a part of their operation.
+
+
+
+ Construct an empty CollectionConstraint
+
+
+
+ Construct a CollectionConstraint
+
+
+
+
+ Flag the constraint to ignore case and return self.
+
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied Comparison object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Compares two collection members for equality
+
+
+
+ Return a new CollectionTally for use in making tests
+
+ The collection to be included in the tally
+
+
+ EmptyCollectionConstraint tests whether a collection is empty.
+
+
+
+ Check that the collection is empty
+
+
+
+
+
+ Write the constraint description to a MessageWriter
+
+
+
+
+ UniqueItemsConstraint tests whether all the items in a
+ collection are unique.
+
+
+
+ Check that all items are unique.
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+ CollectionContainsConstraint is used to test whether a collection
+ contains an expected object as a member.
+
+
+
+ Construct a CollectionContainsConstraint
+
+
+
+
+ Test whether the expected item is contained in the collection
+
+
+
+
+
+ Write a descripton of the constraint to a MessageWriter
+
+
+
+
+ CollectionEquivalentCOnstraint is used to determine whether two
+ collections are equivalent.
+
+
+
+ Construct a CollectionEquivalentConstraint
+
+
+
+
+ Test whether two collections are equivalent
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+ CollectionSubsetConstraint is used to determine whether
+ one collection is a subset of another
+
+
+
+ Construct a CollectionSubsetConstraint
+
+ The collection that the actual value is expected to be a subset of
+
+
+ Test whether the actual collection is a subset of
+ the expected collection provided.
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+ CollectionOrderedConstraint is used to test whether a collection is ordered.
+
+
+
+ Construct a CollectionOrderedConstraint
+
+
+
+ If used performs a reverse comparison
+
+
+
+ Modifies the constraint to use an IComparer and returns self.
+
+
+
+ Modifies the constraint to use an IComparer<T> and returns self.
+
+
+
+ Modifies the constraint to use a Comparison<T> and returns self.
+
+
+
+ Modifies the constraint to test ordering by the value of
+ a specified property and returns self.
+
+
+
+ Test whether the collection is ordered
+
+
+
+
+
+ Write a description of the constraint to a MessageWriter
+
+
+
+
+ Returns the string representation of the constraint.
+
+
+
+
+ CollectionTally counts (tallies) the number of
+ occurences of each object in one or more enumerations.
+
+
+
+ Construct a CollectionTally object from a comparer and a collection
+
+
+
+ The number of objects remaining in the tally
+
+
+
+ Try to remove an object from the tally
+
+ The object to remove
+ True if successful, false if the object was not found
+
+
+ Try to remove a set of objects from the tally
+
+ The objects to remove
+ True if successful, false if any object was not found
+
+
+ ComparisonAdapter class centralizes all comparisons of
+ values in NUnit, adapting to the use of any provided
+ IComparer, IComparer<T> or Comparison<T>
+
+
+
+ Gets the default ComparisonAdapter, which wraps an
+ NUnitComparer object.
+
+
+
+ Returns a ComparisonAdapter that wraps an IComparer
+
+
+
+ Returns a ComparisonAdapter that wraps an IComparer<T>
+
+
+
+ Returns a ComparisonAdapter that wraps a Comparison<T>
+
+
+
+ Compares two objects
+
+
+
+ Construct a default ComparisonAdapter
+
+
+
+ Construct a ComparisonAdapter for an IComparer
+
+
+
+ Compares two objects
+
+
+
+
+
+
+ ComparisonAdapter<T> extends ComparisonAdapter and
+ allows use of an IComparer<T> or Comparison<T>
+ to actually perform the comparison.
+
+
+
+ Construct a ComparisonAdapter for an IComparer<T>
+
+
+
+ Compare a Type T to an object
+
+
+
+ Construct a ComparisonAdapter for a Comparison<T>
+
+
+
+ Compare a Type T to an object
+
+
+
+ Abstract base class for constraints that compare values to
+ determine if one is greater than, equal to or less than
+ the other. This class supplies the Using modifiers.
+
+
+
+ ComparisonAdapter to be used in making the comparison
+
+
+
+ Initializes a new instance of the class.
+
+
+
+ Initializes a new instance of the class.
+
+
+
+ Modifies the constraint to use an IComparer and returns self
+
+
+
+ Modifies the constraint to use an IComparer<T> and returns self
+
+
+
+ Modifies the constraint to use a Comparison<T> and returns self
+
+
+
+ Delegate used to delay evaluation of the actual value
+ to be used in evaluating a constraint
+
+
+
+ The Constraint class is the base of all built-in constraints
+ within NUnit. It provides the operator overloads used to combine
+ constraints.
+
+
+
+ Class used to detect any derived constraints
+ that fail to set the actual value in their
+ Matches override.
+
+
+
+ Static UnsetObject used to detect derived constraints
+ failing to set the actual value.
+
+
+
+ The actual value being tested against a constraint
+
+
+
+ The display name of this Constraint for use by ToString()
+
+
+
+ Argument fields used by ToString();
+
+
+
+ The builder holding this constraint
+
+
+
+ Construct a constraint with no arguments
+
+
+
+ Construct a constraint with one argument
+
+
+
+ Construct a constraint with two arguments
+
+
+
+ Sets the ConstraintBuilder holding this constraint
+
+
+
+ The display name of this Constraint for use by ToString().
+ The default value is the name of the constraint with
+ trailing "Constraint" removed. Derived classes may set
+ this to another name in their constructors.
+
+
+
+ Write the failure message to the MessageWriter provided
+ as an argument. The default implementation simply passes
+ the constraint and the actual value to the writer, which
+ then displays the constraint description and the value.
+ Constraints that need to provide additional details,
+ such as where the error occured can override this.
+
+ The MessageWriter on which to display the message
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Test whether the constraint is satisfied by an
+ ActualValueDelegate that returns the value to be tested.
+ The default implementation simply evaluates the delegate
+ but derived classes may override it to provide for delayed
+ processing.
+
+ An ActualValueDelegate
+ True for success, false for failure
+
+
+ Test whether the constraint is satisfied by a given reference.
+ The default implementation simply dereferences the value but
+ derived classes may override it to provide for delayed processing.
+
+ A reference to the value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+ Default override of ToString returns the constraint DisplayName
+ followed by any arguments within angle brackets.
+
+
+
+
+ Returns the string representation of this constraint
+
+
+
+ This operator creates a constraint that is satisfied only if both
+ argument constraints are satisfied.
+
+
+
+ This operator creates a constraint that is satisfied if either
+ of the argument constraints is satisfied.
+
+
+
+ This operator creates a constraint that is satisfied if the
+ argument constraint is not satisfied.
+
+
+
+ Returns a ConstraintExpression by appending And
+ to the current constraint.
+
+
+
+ Returns a ConstraintExpression by appending And
+ to the current constraint.
+
+
+
+ Returns a ConstraintExpression by appending Or
+ to the current constraint.
+
+
+
+ Returns a DelayedConstraint with the specified delay time.
+
+ The delay in milliseconds.
+
+
+
+ Returns a DelayedConstraint with the specified delay time
+ and polling interval.
+
+ The delay in milliseconds.
+ The interval at which to test the constraint.
+
+
+
+ ConstraintBuilder maintains the stacks that are used in
+ processing a ConstraintExpression. An OperatorStack
+ is used to hold operators that are waiting for their
+ operands to be reognized. a ConstraintStack holds
+ input constraints as well as the results of each
+ operator applied.
+
+
+
+ OperatorStack is a type-safe stack for holding ConstraintOperators
+
+
+
+ Initializes a new instance of the class.
+
+ The builder.
+
+
+ Gets a value indicating whether this is empty.
+
+ true if empty; otherwise, false.
+
+
+ Gets the topmost operator without modifying the stack.
+
+ The top.
+
+
+ Pushes the specified operator onto the stack.
+
+ The op.
+
+
+ Pops the topmost operator from the stack.
+
+
+
+
+ ConstraintStack is a type-safe stack for holding Constraints
+
+
+
+ Initializes a new instance of the class.
+
+ The builder.
+
+
+ Gets a value indicating whether this is empty.
+
+ true if empty; otherwise, false.
+
+
+ Gets the topmost constraint without modifying the stack.
+
+ The topmost constraint
+
+
+ Pushes the specified constraint. As a side effect,
+ the constraint's builder field is set to the
+ ConstraintBuilder owning this stack.
+
+ The constraint.
+
+
+ Pops this topmost constrait from the stack.
+ As a side effect, the constraint's builder
+ field is set to null.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+ Gets a value indicating whether this instance is resolvable.
+
+
+ true if this instance is resolvable; otherwise, false.
+
+
+
+ Appends the specified operator to the expression by first
+ reducing the operator stack and then pushing the new
+ operator on the stack.
+
+ The operator to push.
+
+
+ Appends the specified constraint to the expresson by pushing
+ it on the constraint stack.
+
+ The constraint to push.
+
+
+ Sets the top operator right context.
+
+ The right context.
+
+
+ Reduces the operator stack until the topmost item
+ precedence is greater than or equal to the target precedence.
+
+ The target precedence.
+
+
+ Resolves this instance, returning a Constraint. If the builder
+ is not currently in a resolvable state, an exception is thrown.
+
+ The resolved constraint
+
+
+ ConstraintExpression represents a compound constraint in the
+ process of being constructed from a series of syntactic elements.
+ Individual elements are appended to the expression as they are
+ reognized. Once an actual Constraint is appended, the expression
+ returns a resolvable Constraint.
+
+
+
+ Initializes a new instance of the class.
+
+
+
+ Initializes a new instance of the
+ class passing in a ConstraintBuilder, which may be pre-populated.
+
+ The builder.
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them succeed.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if at least one of them succeeds.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them fail.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding only if a specified number of them succeed.
+
+
+
+ Returns a new PropertyConstraintExpression, which will either
+ test for the existence of the named property on the object
+ being tested or apply any following constraint to that property.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Length property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Count property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Message property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the InnerException property of the object being tested.
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+ With is currently a NOP - reserved for future use.
+
+
+
+ Returns the constraint provided as an argument - used to allow custom
+ custom constraints to easily participate in the syntax.
+
+
+
+ Returns the constraint provided as an argument - used to allow custom
+ custom constraints to easily participate in the syntax.
+
+
+
+ Returns a constraint that tests for null
+
+
+
+ Returns a constraint that tests for True
+
+
+
+ Returns a constraint that tests for False
+
+
+
+ Returns a constraint that tests for a positive value
+
+
+
+ Returns a constraint that tests for a negative value
+
+
+
+ Returns a constraint that tests for NaN
+
+
+
+ Returns a constraint that tests for empty
+
+
+
+ Returns a constraint that tests whether a collection
+ contains all unique items.
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in binary format.
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in xml format.
+
+
+
+ Returns a constraint that tests two items for equality
+
+
+
+ Returns a constraint that tests that two references are the same object
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a collection containing the same elements as the
+ collection supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a subset of the collection supplied as an argument.
+
+
+
+ Returns a constraint that tests whether a collection is ordered
+
+
+
+ Returns a new CollectionContainsConstraint checking for the
+ presence of a particular object in the collection.
+
+
+
+ Returns a new CollectionContainsConstraint checking for the
+ presence of a particular object in the collection.
+
+
+
+ Returns a new ContainsConstraint. This constraint
+ will, in turn, make use of the appropriate second-level
+ constraint, depending on the type of the actual argument.
+ This overload is only used if the item sought is a string,
+ since any other type implies that we are looking for a
+ collection member.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the Regex pattern supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the Regex pattern supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same as an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same path or under an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same path or under an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the actual value falls
+ within a specified range.
+
+
+
+ ConstraintExpressionBase is the abstract base class for the
+ ConstraintExpression class, which represents a
+ compound constraint in the process of being constructed
+ from a series of syntactic elements.
+ NOTE: ConstraintExpressionBase is separate because the
+ ConstraintExpression class was generated in earlier
+ versions of NUnit. The two classes may be combined
+ in a future version.
+
+
+
+ The ConstraintBuilder holding the elements recognized so far
+
+
+
+ Initializes a new instance of the class.
+
+
+
+ Initializes a new instance of the
+ class passing in a ConstraintBuilder, which may be pre-populated.
+
+ The builder.
+
+
+ Returns a string representation of the expression as it
+ currently stands. This should only be used for testing,
+ since it has the side-effect of resolving the expression.
+
+
+
+
+ Appends an operator to the expression and returns the
+ resulting expression itself.
+
+
+
+ Appends a self-resolving operator to the expression and
+ returns a new ResolvableConstraintExpression.
+
+
+
+ Appends a constraint to the expression and returns that
+ constraint, which is associated with the current state
+ of the expression being built.
+
+
+
+ Helper class with properties and methods that supply
+ a number of constraints used in Asserts.
+
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them succeed.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if at least one of them succeeds.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them fail.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding only if a specified number of them succeed.
+
+
+
+ Returns a new PropertyConstraintExpression, which will either
+ test for the existence of the named property on the object
+ being tested or apply any following constraint to that property.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Length property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Count property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Message property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the InnerException property of the object being tested.
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+ Returns a constraint that tests for null
+
+
+
+ Returns a constraint that tests for True
+
+
+
+ Returns a constraint that tests for False
+
+
+
+ Returns a constraint that tests for a positive value
+
+
+
+ Returns a constraint that tests for a negative value
+
+
+
+ Returns a constraint that tests for NaN
+
+
+
+ Returns a constraint that tests for empty
+
+
+
+ Returns a constraint that tests whether a collection
+ contains all unique items.
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in binary format.
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in xml format.
+
+
+
+ Returns a constraint that tests two items for equality
+
+
+
+ Returns a constraint that tests that two references are the same object
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a collection containing the same elements as the
+ collection supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a subset of the collection supplied as an argument.
+
+
+
+ Returns a constraint that tests whether a collection is ordered
+
+
+
+ Returns a new CollectionContainsConstraint checking for the
+ presence of a particular object in the collection.
+
+
+
+ Returns a new CollectionContainsConstraint checking for the
+ presence of a particular object in the collection.
+
+
+
+ Returns a new ContainsConstraint. This constraint
+ will, in turn, make use of the appropriate second-level
+ constraint, depending on the type of the actual argument.
+ This overload is only used if the item sought is a string,
+ since any other type implies that we are looking for a
+ collection member.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+ Returns a constraint that fails if the actual
+ value contains the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+ Returns a constraint that fails if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+ Returns a constraint that fails if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the Regex pattern supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the Regex pattern supplied as an argument.
+
+
+
+ Returns a constraint that fails if the actual
+ value matches the pattern supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same as an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same path or under an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same path or under an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the actual value falls
+ within a specified range.
+
+
+
+ The ConstraintOperator class is used internally by a
+ ConstraintBuilder to represent an operator that
+ modifies or combines constraints.
+ Constraint operators use left and right precedence
+ values to determine whether the top operator on the
+ stack should be reduced before pushing a new operator.
+
+
+
+ The precedence value used when the operator
+ is about to be pushed to the stack.
+
+
+
+ The precedence value used when the operator
+ is on the top of the stack.
+
+
+
+ The syntax element preceding this operator
+
+
+
+ The syntax element folowing this operator
+
+
+
+ The precedence value used when the operator
+ is about to be pushed to the stack.
+
+
+
+ The precedence value used when the operator
+ is on the top of the stack.
+
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+
+ PrefixOperator takes a single constraint and modifies
+ it's action in some way.
+
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+
+ Returns the constraint created by applying this
+ prefix to another constraint.
+
+
+
+
+
+ Negates the test of the constraint it wraps.
+
+
+
+ Constructs a new NotOperator
+
+
+
+ Returns a NotConstraint applied to its argument.
+
+
+
+ Abstract base for operators that indicate how to
+ apply a constraint to items in a collection.
+
+
+
+ Constructs a CollectionOperator
+
+
+
+ Represents a constraint that succeeds if all the
+ members of a collection match a base constraint.
+
+
+
+ Returns a constraint that will apply the argument
+ to the members of a collection, succeeding if
+ they all succeed.
+
+
+
+ Represents a constraint that succeeds if any of the
+ members of a collection match a base constraint.
+
+
+
+ Returns a constraint that will apply the argument
+ to the members of a collection, succeeding if
+ any of them succeed.
+
+
+
+ Represents a constraint that succeeds if none of the
+ members of a collection match a base constraint.
+
+
+
+ Returns a constraint that will apply the argument
+ to the members of a collection, succeeding if
+ none of them succeed.
+
+
+
+ Represents a constraint that succeeds if the specified
+ count of members of a collection match a base constraint.
+
+
+
+ Construct an ExactCountOperator for a specified count
+
+ The expected count
+
+
+ Returns a constraint that will apply the argument
+ to the members of a collection, succeeding if
+ none of them succeed.
+
+
+
+ Represents a constraint that simply wraps the
+ constraint provided as an argument, without any
+ further functionality, but which modifes the
+ order of evaluation because of its precedence.
+
+
+
+ Constructor for the WithOperator
+
+
+
+ Returns a constraint that wraps its argument
+
+
+
+ Abstract base class for operators that are able to reduce to a
+ constraint whether or not another syntactic element follows.
+
+
+
+ Operator used to test for the presence of a named Property
+ on an object and optionally apply further tests to the
+ value of that property.
+
+
+
+ Gets the name of the property to which the operator applies
+
+
+
+ Constructs a PropOperator for a particular named property
+
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+
+ Operator that tests for the presence of a particular attribute
+ on a type and optionally applies further tests to the attribute.
+
+
+
+ Construct an AttributeOperator for a particular Type
+
+ The Type of attribute tested
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+ Operator that tests that an exception is thrown and
+ optionally applies further tests to the exception.
+
+
+
+ Construct a ThrowsOperator
+
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+ Abstract base class for all binary operators
+
+
+
+ Reduce produces a constraint from the operator and
+ any arguments. It takes the arguments from the constraint
+ stack and pushes the resulting constraint on it.
+
+
+
+
+ Gets the left precedence of the operator
+
+
+
+ Gets the right precedence of the operator
+
+
+
+ Abstract method that produces a constraint by applying
+ the operator to its left and right constraint arguments.
+
+
+
+ Operator that requires both it's arguments to succeed
+
+
+
+ Construct an AndOperator
+
+
+
+ Apply the operator to produce an AndConstraint
+
+
+
+ Operator that requires at least one of it's arguments to succeed
+
+
+
+ Construct an OrOperator
+
+
+
+ Apply the operator to produce an OrConstraint
+
+
+
+ ContainsConstraint tests a whether a string contains a substring
+ or a collection contains an object. It postpones the decision of
+ which test to use until the type of the actual argument is known.
+ This allows testing whether a string is contained in a collection
+ or as a substring of another string using the same syntax.
+
+
+
+ Initializes a new instance of the class.
+
+ The expected.
+
+
+ Flag the constraint to ignore case and return self.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied Comparison object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Applies a delay to the match so that a match can be evaluated in the future.
+
+
+
+ Creates a new DelayedConstraint
+
+ The inner constraint two decorate
+ The time interval after which the match is performed
+ If the value of is less than 0
+
+
+ Creates a new DelayedConstraint
+
+ The inner constraint two decorate
+ The time interval after which the match is performed
+ The time interval used for polling
+ If the value of is less than 0
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for if the base constraint fails, false if it succeeds
+
+
+ Test whether the constraint is satisfied by a delegate
+
+ The delegate whose value is to be tested
+ True for if the base constraint fails, false if it succeeds
+
+
+ Test whether the constraint is satisfied by a given reference.
+ Overridden to wait for the specified delay period before
+ calling the base constraint with the dereferenced value.
+
+ A reference to the value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a MessageWriter.
+
+ The writer on which the actual value is displayed
+
+
+ Returns the string representation of the constraint.
+
+
+
+ EmptyDirectoryConstraint is used to test that a directory is empty
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+ EmptyConstraint tests a whether a string or collection is empty,
+ postponing the decision about which test is applied until the
+ type of the actual argument is known.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ EqualConstraint is able to compare an actual value with the
+ expected value provided in its constructor. Two objects are
+ considered equal if both are null, or if both have the same
+ value. NUnit has special semantics for some object types.
+
+
+
+ If true, strings in error messages will be clipped
+
+
+
+ NUnitEqualityComparer used to test equality.
+
+
+
+ Initializes a new instance of the class.
+
+ The expected value.
+
+
+ Flag the constraint to ignore case and return self.
+
+
+
+ Flag the constraint to suppress string clipping
+ and return self.
+
+
+
+ Flag the constraint to compare arrays as collections
+ and return self.
+
+
+
+ Flag the constraint to use a tolerance when determining equality.
+
+ Tolerance value to be used
+ Self.
+
+
+ Switches the .Within() modifier to interpret its tolerance as
+ a distance in representable values (see remarks).
+
+ Self.
+
+ Ulp stands for "unit in the last place" and describes the minimum
+ amount a given value can change. For any integers, an ulp is 1 whole
+ digit. For floating point values, the accuracy of which is better
+ for smaller numbers and worse for larger numbers, an ulp depends
+ on the size of the number. Using ulps for comparison of floating
+ point results instead of fixed tolerances is safer because it will
+ automatically compensate for the added inaccuracy of larger numbers.
+
+
+
+ Switches the .Within() modifier to interpret its tolerance as
+ a percentage that the actual values is allowed to deviate from
+ the expected value.
+
+ Self
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in days.
+
+ Self
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in hours.
+
+ Self
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in minutes.
+
+ Self
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in seconds.
+
+ Self
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in milliseconds.
+
+ Self
+
+
+ Causes the tolerance to be interpreted as a TimeSpan in clock ticks.
+
+ Self
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied Comparison object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Flag the constraint to use the supplied IEqualityComparer object.
+
+ The IComparer object to use.
+ Self.
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write a failure message. Overridden to provide custom
+ failure messages for EqualConstraint.
+
+ The MessageWriter to write to
+
+
+ Write description of this constraint
+
+ The MessageWriter to write to
+
+
+ Display the failure information for two collections that did not match.
+
+ The MessageWriter on which to display
+ The expected collection.
+ The actual collection
+ The depth of this failure in a set of nested collections
+
+
+ Displays a single line showing the types and sizes of the expected
+ and actual enumerations, collections or arrays. If both are identical,
+ the value is only shown once.
+
+ The MessageWriter on which to display
+ The expected collection or array
+ The actual collection or array
+ The indentation level for the message line
+
+
+ Displays a single line showing the point in the expected and actual
+ arrays at which the comparison failed. If the arrays have different
+ structures or dimensions, both values are shown.
+
+ The MessageWriter on which to display
+ The expected array
+ The actual array
+ Index of the failure point in the underlying collections
+ The indentation level for the message line
+
+
+ Display the failure information for two IEnumerables that did not match.
+
+ The MessageWriter on which to display
+ The expected enumeration.
+ The actual enumeration
+ The depth of this failure in a set of nested collections
+
+
+ EqualityAdapter class handles all equality comparisons
+ that use an IEqualityComparer, IEqualityComparer<T>
+ or a ComparisonAdapter.
+
+
+
+ Compares two objects, returning true if they are equal
+
+
+
+ Returns true if the two objects can be compared by this adapter.
+ The base adapter cannot handle IEnumerables except for strings.
+
+
+
+ Returns an EqualityAdapter that wraps an IComparer.
+
+
+
+ EqualityAdapter that wraps an IComparer.
+
+
+
+ Returns an EqualityAdapter that wraps an IEqualityComparer.
+
+
+
+ Returns true if the two objects can be compared by this adapter.
+ Generic adapter requires objects of the specified type.
+
+
+
+ Returns an EqualityAdapter that wraps an IEqualityComparer<T>.
+
+
+
+ Returns an EqualityAdapter that wraps an IComparer<T>.
+
+
+
+ EqualityAdapter that wraps an IComparer.
+
+
+
+ Returns an EqualityAdapter that wraps a Comparison<T>.
+
+
+ Helper routines for working with floating point numbers
+
+
+ The floating point comparison code is based on this excellent article:
+ http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
+
+
+ "ULP" means Unit in the Last Place and in the context of this library refers to
+ the distance between two adjacent floating point numbers. IEEE floating point
+ numbers can only represent a finite subset of natural numbers, with greater
+ accuracy for smaller numbers and lower accuracy for very large numbers.
+
+
+ If a comparison is allowed "2 ulps" of deviation, that means the values are
+ allowed to deviate by up to 2 adjacent floating point values, which might be
+ as low as 0.0000001 for small numbers or as high as 10.0 for large numbers.
+
+
+
+ Union of a floating point variable and an integer
+
+ The union's value as a floating point variable
+
+ The union's value as an integer
+
+ The union's value as an unsigned integer
+
+ Union of a double precision floating point variable and a long
+
+ The union's value as a double precision floating point variable
+
+ The union's value as a long
+
+ The union's value as an unsigned long
+
+ Compares two floating point values for equality
+ First floating point value to be compared
+ Second floating point value t be compared
+
+ Maximum number of representable floating point values that are allowed to
+ be between the left and the right floating point values
+
+ True if both numbers are equal or close to being equal
+
+
+ Floating point values can only represent a finite subset of natural numbers.
+ For example, the values 2.00000000 and 2.00000024 can be stored in a float,
+ but nothing inbetween them.
+
+
+ This comparison will count how many possible floating point values are between
+ the left and the right number. If the number of possible values between both
+ numbers is less than or equal to maxUlps, then the numbers are considered as
+ being equal.
+
+
+ Implementation partially follows the code outlined here:
+ http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/
+
+
+
+ Compares two double precision floating point values for equality
+ First double precision floating point value to be compared
+ Second double precision floating point value t be compared
+
+ Maximum number of representable double precision floating point values that are
+ allowed to be between the left and the right double precision floating point values
+
+ True if both numbers are equal or close to being equal
+
+
+ Double precision floating point values can only represent a limited series of
+ natural numbers. For example, the values 2.0000000000000000 and 2.0000000000000004
+ can be stored in a double, but nothing inbetween them.
+
+
+ This comparison will count how many possible double precision floating point
+ values are between the left and the right number. If the number of possible
+ values between both numbers is less than or equal to maxUlps, then the numbers
+ are considered as being equal.
+
+
+ Implementation partially follows the code outlined here:
+ http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/
+
+
+
+
+ Reinterprets the memory contents of a floating point value as an integer value
+
+
+ Floating point value whose memory contents to reinterpret
+
+
+ The memory contents of the floating point value interpreted as an integer
+
+
+
+ Reinterprets the memory contents of a double precision floating point
+ value as an integer value
+
+
+ Double precision floating point value whose memory contents to reinterpret
+
+
+ The memory contents of the double precision floating point value
+ interpreted as an integer
+
+
+
+ Reinterprets the memory contents of an integer as a floating point value
+
+ Integer value whose memory contents to reinterpret
+
+ The memory contents of the integer value interpreted as a floating point value
+
+
+
+ Reinterprets the memory contents of an integer value as a double precision
+ floating point value
+
+ Integer whose memory contents to reinterpret
+
+ The memory contents of the integer interpreted as a double precision
+ floating point value
+
+
+
+ Tests whether a value is greater than the value supplied to its constructor
+
+
+
+ The value against which a comparison is to be made
+
+
+
+ Initializes a new instance of the class.
+
+ The expected value.
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Tests whether a value is greater than or equal to the value supplied to its constructor
+
+
+
+ The value against which a comparison is to be made
+
+
+
+ Initializes a new instance of the class.
+
+ The expected value.
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ The IConstraintExpression interface is implemented by all
+ complete and resolvable constraints and expressions.
+
+
+
+ Return the top-level constraint for this expression
+
+
+
+
+ Tests whether a value is less than the value supplied to its constructor
+
+
+
+ The value against which a comparison is to be made
+
+
+
+ Initializes a new instance of the class.
+
+ The expected value.
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Tests whether a value is less than or equal to the value supplied to its constructor
+
+
+
+ The value against which a comparison is to be made
+
+
+
+ Initializes a new instance of the class.
+
+ The expected value.
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ MessageWriter is the abstract base for classes that write
+ constraint descriptions and messages in some form. The
+ class has separate methods for writing various components
+ of a message, allowing implementations to tailor the
+ presentation as needed.
+
+
+
+ Construct a MessageWriter given a culture
+
+
+
+ Abstract method to get the max line length
+
+
+
+ Method to write single line message with optional args, usually
+ written to precede the general failure message.
+
+ The message to be written
+ Any arguments used in formatting the message
+
+
+ Method to write single line message with optional args, usually
+ written to precede the general failure message, at a givel
+ indentation level.
+
+ The indentation level of the message
+ The message to be written
+ Any arguments used in formatting the message
+
+
+ Display Expected and Actual lines for a constraint. This
+ is called by MessageWriter's default implementation of
+ WriteMessageTo and provides the generic two-line display.
+
+ The constraint that failed
+
+
+ Display Expected and Actual lines for given values. This
+ method may be called by constraints that need more control over
+ the display of actual and expected values than is provided
+ by the default implementation.
+
+ The expected value
+ The actual value causing the failure
+
+
+ Display Expected and Actual lines for given values, including
+ a tolerance value on the Expected line.
+
+ The expected value
+ The actual value causing the failure
+ The tolerance within which the test was made
+
+
+ Display the expected and actual string values on separate lines.
+ If the mismatch parameter is >=0, an additional line is displayed
+ line containing a caret that points to the mismatch point.
+
+ The expected string value
+ The actual string value
+ The point at which the strings don't match or -1
+ If true, case is ignored in locating the point where the strings differ
+ If true, the strings should be clipped to fit the line
+
+
+ Writes the text for a connector.
+
+ The connector.
+
+
+ Writes the text for a predicate.
+
+ The predicate.
+
+
+ Writes the text for an expected value.
+
+ The expected value.
+
+
+ Writes the text for a modifier
+
+ The modifier.
+
+
+ Writes the text for an actual value.
+
+ The actual value.
+
+
+ Writes the text for a generalized value.
+
+ The value.
+
+
+ Writes the text for a collection value,
+ starting at a particular point, to a max length
+
+ The collection containing elements to write.
+ The starting point of the elements to write
+ The maximum number of elements to write
+
+
+ Static methods used in creating messages
+
+
+
+ Static string used when strings are clipped
+
+
+
+ Returns the representation of a type as used in NUnitLite.
+ This is the same as Type.ToString() except for arrays,
+ which are displayed with their declared sizes.
+
+
+
+
+
+ Converts any control characters in a string
+ to their escaped representation.
+
+ The string to be converted
+ The converted string
+
+
+ Return the a string representation for a set of indices into an array
+
+ Array of indices for which a string is needed
+
+
+ Get an array of indices representing the point in a enumerable,
+ collection or array corresponding to a single int index into the
+ collection.
+
+ The collection to which the indices apply
+ Index in the collection
+ Array of indices
+
+
+ Clip a string to a given length, starting at a particular offset, returning the clipped
+ string with ellipses representing the removed parts
+
+ The string to be clipped
+ The maximum permitted length of the result string
+ The point at which to start clipping
+ The clipped string
+
+
+ Clip the expected and actual strings in a coordinated fashion,
+ so that they may be displayed together.
+
+
+
+
+
+
+
+ Shows the position two strings start to differ. Comparison
+ starts at the start index.
+
+ The expected string
+ The actual string
+ The index in the strings at which comparison should start
+ Boolean indicating whether case should be ignored
+ -1 if no mismatch found, or the index where mismatch found
+
+
+ The Numerics class contains common operations on numeric values.
+
+
+
+ Checks the type of the object, returning true if
+ the object is a numeric type.
+
+ The object to check
+ true if the object is a numeric type
+
+
+ Checks the type of the object, returning true if
+ the object is a floating point numeric type.
+
+ The object to check
+ true if the object is a floating point numeric type
+
+
+ Checks the type of the object, returning true if
+ the object is a fixed point numeric type.
+
+ The object to check
+ true if the object is a fixed point numeric type
+
+
+ Test two numeric values for equality, performing the usual numeric
+ conversions and using a provided or default tolerance. If the tolerance
+ provided is Empty, this method may set it to a default tolerance.
+
+ The expected value
+ The actual value
+ A reference to the tolerance in effect
+ True if the values are equal
+
+
+ Compare two numeric values, performing the usual numeric conversions.
+
+ The expected value
+ The actual value
+ The relationship of the values to each other
+
+
+ NUnitComparer encapsulates NUnit's default behavior
+ in comparing two objects.
+
+
+
+ Returns the default NUnitComparer.
+
+
+
+ Compares two objects
+
+
+
+
+
+
+ Generic version of NUnitComparer
+
+
+
+
+ Compare two objects of the same type
+
+
+
+ NUnitEqualityComparer encapsulates NUnit's handling of
+ equality tests between objects.
+
+
+
+ If true, all string comparisons will ignore case
+
+
+
+ If true, arrays will be treated as collections, allowing
+ those of different dimensions to be compared
+
+
+
+ Comparison objects used in comparisons for some constraints.
+
+
+
+ Returns the default NUnitEqualityComparer
+
+
+
+ Gets and sets a flag indicating whether case should
+ be ignored in determining equality.
+
+
+
+ Gets and sets a flag indicating that arrays should be
+ compared as collections, without regard to their shape.
+
+
+
+ Gets and sets an external comparer to be used to
+ test for equality. It is applied to members of
+ collections, in place of NUnit's own logic.
+
+
+
+ Gets the list of failure points for the last Match performed.
+
+
+
+ Compares two objects for equality within a tolerance.
+
+
+
+ Helper method to compare two arrays
+
+
+
+ Method to compare two DirectoryInfo objects
+
+ first directory to compare
+ second directory to compare
+ true if equivalent, false if not
+
+
+ FailurePoint class represents one point of failure
+ in an equality test.
+
+
+
+ The location of the failure
+
+
+
+ The expected value
+
+
+
+ The actual value
+
+
+
+ Indicates whether the expected value is valid
+
+
+
+ Indicates whether the actual value is valid
+
+
+
+ PathConstraint serves as the abstract base of constraints
+ that operate on paths and provides several helper methods.
+
+
+
+ The expected path used in the constraint
+
+
+
+ The actual path being tested
+
+
+
+ Flag indicating whether a caseInsensitive comparison should be made
+
+
+
+ Construct a PathConstraint for a give expected path
+
+ The expected path
+
+
+ Modifies the current instance to be case-insensitve
+ and returns it.
+
+
+
+ Modifies the current instance to be case-sensitve
+ and returns it.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Returns true if the expected path and actual path match
+
+
+
+ Returns the string representation of this constraint
+
+
+
+ Canonicalize the provided path
+
+
+ The path in standardized form
+
+
+ Test whether two paths are the same
+
+ The first path
+ The second path
+ Indicates whether case should be ignored
+
+
+
+ Test whether one path is under another path
+
+ The first path - supposed to be the parent path
+ The second path - supposed to be the child path
+ Indicates whether case should be ignored
+
+
+
+ Test whether one path is the same as or under another path
+
+ The first path - supposed to be the parent path
+ The second path - supposed to be the child path
+
+
+
+ Summary description for SamePathConstraint.
+
+
+
+ Initializes a new instance of the class.
+
+ The expected path
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The expected path
+ The actual path
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ SubPathConstraint tests that the actual path is under the expected path
+
+
+
+ Initializes a new instance of the class.
+
+ The expected path
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The expected path
+ The actual path
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ SamePathOrUnderConstraint tests that one path is under another
+
+
+
+ Initializes a new instance of the class.
+
+ The expected path
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The expected path
+ The actual path
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Predicate constraint wraps a Predicate in a constraint,
+ returning success if the predicate is true.
+
+
+
+ Construct a PredicateConstraint from a predicate
+
+
+
+ Determines whether the predicate succeeds when applied
+ to the actual value.
+
+
+
+ Writes the description to a MessageWriter
+
+
+
+ Abstract base class used for prefixes
+
+
+
+ The base constraint
+
+
+
+ Construct given a base constraint
+
+
+
+
+ NotConstraint negates the effect of some other constraint
+
+
+
+ Initializes a new instance of the class.
+
+ The base constraint to be negated.
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for if the base constraint fails, false if it succeeds
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a MessageWriter.
+
+ The writer on which the actual value is displayed
+
+
+ AllItemsConstraint applies another constraint to each
+ item in a collection, succeeding if they all succeed.
+
+
+
+ Construct an AllItemsConstraint on top of an existing constraint
+
+
+
+
+ Apply the item constraint to each item in the collection,
+ failing if any item fails.
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+ SomeItemsConstraint applies another constraint to each
+ item in a collection, succeeding if any of them succeeds.
+
+
+
+ Construct a SomeItemsConstraint on top of an existing constraint
+
+
+
+
+ Apply the item constraint to each item in the collection,
+ succeeding if any item succeeds.
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+ NoItemConstraint applies another constraint to each
+ item in a collection, failing if any of them succeeds.
+
+
+
+ Construct a NoItemConstraint on top of an existing constraint
+
+
+
+
+ Apply the item constraint to each item in the collection,
+ failing if any item fails.
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+ ExactCoutConstraint applies another constraint to each
+ item in a collection, succeeding only if a specified
+ number of items succeed.
+
+
+
+ Construct an ExactCountConstraint on top of an existing constraint
+
+
+
+
+
+ Apply the item constraint to each item in the collection,
+ succeeding only if the expected number of items pass.
+
+
+
+
+
+ Write a description of this constraint to a MessageWriter
+
+
+
+
+ PropertyExistsConstraint tests that a named property
+ exists on the object provided through Match.
+ Originally, PropertyConstraint provided this feature
+ in addition to making optional tests on the vaue
+ of the property. The two constraints are now separate.
+
+
+
+ Initializes a new instance of the class.
+
+ The name of the property.
+
+
+ Test whether the property exists for a given object
+
+ The object to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter.
+
+ The writer on which the actual value is displayed
+
+
+ Returns the string representation of the constraint.
+
+
+
+
+ PropertyConstraint extracts a named property and uses
+ its value as the actual value for a chained constraint.
+
+
+
+ Initializes a new instance of the class.
+
+ The name.
+ The constraint to apply to the property.
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+ Returns the string representation of the constraint.
+
+
+
+
+ RangeConstraint tests whethe two values are within a
+ specified range.
+
+
+
+ Initializes a new instance of the class.
+
+ From.
+ To.
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ ResolvableConstraintExpression is used to represent a compound
+ constraint being constructed at a point where the last operator
+ may either terminate the expression or may have additional
+ qualifying constraints added to it.
+ It is used, for example, for a Property element or for
+ an Exception element, either of which may be optionally
+ followed by constraints that apply to the property or
+ exception.
+
+
+
+ Create a new instance of ResolvableConstraintExpression
+
+
+
+ Create a new instance of ResolvableConstraintExpression,
+ passing in a pre-populated ConstraintBuilder.
+
+
+
+ Appends an And Operator to the expression
+
+
+
+ Appends an Or operator to the expression.
+
+
+
+ Resolve the current expression to a Constraint
+
+
+
+ This operator creates a constraint that is satisfied only if both
+ argument constraints are satisfied.
+
+
+
+ This operator creates a constraint that is satisfied only if both
+ argument constraints are satisfied.
+
+
+
+ This operator creates a constraint that is satisfied only if both
+ argument constraints are satisfied.
+
+
+
+ This operator creates a constraint that is satisfied if either
+ of the argument constraints is satisfied.
+
+
+
+ This operator creates a constraint that is satisfied if either
+ of the argument constraints is satisfied.
+
+
+
+ This operator creates a constraint that is satisfied if either
+ of the argument constraints is satisfied.
+
+
+
+ This operator creates a constraint that is satisfied if the
+ argument constraint is not satisfied.
+
+
+
+ ReusableConstraint wraps a resolved constraint so that it
+ may be saved and reused as needed.
+
+
+
+ Construct a ReusableConstraint
+
+ The constraint or expression to be reused
+
+
+ Conversion operator from a normal constraint to a ReusableConstraint.
+
+ The original constraint to be wrapped as a ReusableConstraint
+
+
+
+ Returns the string representation of the constraint.
+
+ A string representing the constraint
+
+
+ Resolves the ReusableConstraint by returning the constraint
+ that it originally wrapped.
+
+ A resolved constraint
+
+
+ SameAsConstraint tests whether an object is identical to
+ the object passed to its constructor
+
+
+
+ Initializes a new instance of the class.
+
+ The expected object.
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ BinarySerializableConstraint tests whether
+ an object is serializable in binary format.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+ Returns the string representation
+
+
+
+ BinarySerializableConstraint tests whether
+ an object is serializable in binary format.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+ Returns the string representation of this constraint
+
+
+
+ StringConstraint is the abstract base for constraints
+ that operate on strings. It supports the IgnoreCase
+ modifier for string operations.
+
+
+
+ The expected value
+
+
+
+ Indicates whether tests should be case-insensitive
+
+
+
+ Constructs a StringConstraint given an expected value
+
+ The expected value
+
+
+ Modify the constraint to ignore case in matching.
+
+
+
+ EmptyStringConstraint tests whether a string is empty.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ NullEmptyStringConstraint tests whether a string is either null or empty.
+
+
+
+ Constructs a new NullOrEmptyStringConstraint
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ SubstringConstraint can test whether a string contains
+ the expected substring.
+
+
+
+ Initializes a new instance of the class.
+
+ The expected.
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ StartsWithConstraint can test whether a string starts
+ with an expected substring.
+
+
+
+ Initializes a new instance of the class.
+
+ The expected string
+
+
+ Test whether the constraint is matched by the actual value.
+ This is a template method, which calls the IsMatch method
+ of the derived class.
+
+
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ EndsWithConstraint can test whether a string ends
+ with an expected substring.
+
+
+
+ Initializes a new instance of the class.
+
+ The expected string
+
+
+ Test whether the constraint is matched by the actual value.
+ This is a template method, which calls the IsMatch method
+ of the derived class.
+
+
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ RegexConstraint can test whether a string matches
+ the pattern provided.
+
+
+
+ Initializes a new instance of the class.
+
+ The pattern.
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True for success, false for failure
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ ThrowsConstraint is used to test the exception thrown by
+ a delegate by applying a constraint to it.
+
+
+
+ Initializes a new instance of the class,
+ using a constraint to be applied to the exception.
+
+ A constraint to apply to the caught exception.
+
+
+ Get the actual exception thrown - used by Assert.Throws.
+
+
+
+ Executes the code of the delegate and captures any exception.
+ If a non-null base constraint was provided, it applies that
+ constraint to the exception.
+
+ A delegate representing the code to be tested
+ True if an exception is thrown and the constraint succeeds, otherwise false
+
+
+ Converts an ActualValueDelegate to a TestDelegate
+ before calling the primary overload.
+
+
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+ Returns the string representation of this constraint
+
+
+
+ ThrowsNothingConstraint tests that a delegate does not
+ throw an exception.
+
+
+
+ Test whether the constraint is satisfied by a given value
+
+ The value to be tested
+ True if no exception is thrown, otherwise false
+
+
+ Converts an ActualValueDelegate to a TestDelegate
+ before calling the primary overload.
+
+
+
+
+
+ Write the constraint description to a MessageWriter
+
+ The writer on which the description is displayed
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. The default implementation simply writes
+ the raw value of actual, leaving it to the writer to
+ perform any formatting.
+
+ The writer on which the actual value is displayed
+
+
+ Modes in which the tolerance value for a comparison can
+ be interpreted.
+
+
+
+ The tolerance was created with a value, without specifying
+ how the value would be used. This is used to prevent setting
+ the mode more than once and is generally changed to Linear
+ upon execution of the test.
+
+
+
+ The tolerance is used as a numeric range within which
+ two compared values are considered to be equal.
+
+
+
+ Interprets the tolerance as the percentage by which
+ the two compared values my deviate from each other.
+
+
+
+ Compares two values based in their distance in
+ representable numbers.
+
+
+
+ The Tolerance class generalizes the notion of a tolerance
+ within which an equality test succeeds. Normally, it is
+ used with numeric types, but it can be used with any
+ type that supports taking a difference between two
+ objects and comparing that difference to a value.
+
+
+
+ Returns an empty Tolerance object, equivalent to
+ specifying no tolerance. In most cases, it results
+ in an exact match but for floats and doubles a
+ default tolerance may be used.
+
+
+
+ Returns a zero Tolerance object, equivalent to
+ specifying an exact match.
+
+
+
+ Constructs a linear tolerance of a specdified amount
+
+
+
+ Constructs a tolerance given an amount and ToleranceMode
+
+
+
+ Gets the ToleranceMode for the current Tolerance
+
+
+
+ Tests that the current Tolerance is linear with a
+ numeric value, throwing an exception if it is not.
+
+
+
+ Gets the value of the current Tolerance instance.
+
+
+
+ Returns a new tolerance, using the current amount as a percentage.
+
+
+
+ Returns a new tolerance, using the current amount in Ulps.
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of days.
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of hours.
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of minutes.
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of seconds.
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of milliseconds.
+
+
+
+ Returns a new tolerance with a TimeSpan as the amount, using
+ the current amount as a number of clock ticks.
+
+
+
+ Returns true if the current tolerance is empty.
+
+
+
+ TypeConstraint is the abstract base for constraints
+ that take a Type as their expected value.
+
+
+
+ The expected Type used by the constraint
+
+
+
+ Construct a TypeConstraint for a given Type
+
+
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. TypeConstraints override this method to write
+ the name of the type.
+
+ The writer on which the actual value is displayed
+
+
+ ExactTypeConstraint is used to test that an object
+ is of the exact type provided in the constructor
+
+
+
+ Construct an ExactTypeConstraint for a given Type
+
+ The expected Type.
+
+
+ Test that an object is of the exact type specified
+
+ The actual value.
+ True if the tested object is of the exact type provided, otherwise false.
+
+
+ Write the description of this constraint to a MessageWriter
+
+ The MessageWriter to use
+
+
+ ExceptionTypeConstraint is a special version of ExactTypeConstraint
+ used to provided detailed info about the exception thrown in
+ an error message.
+
+
+
+ Constructs an ExceptionTypeConstraint
+
+
+
+ Write the actual value for a failing constraint test to a
+ MessageWriter. Overriden to write additional information
+ in the case of an Exception.
+
+ The MessageWriter to use
+
+
+ InstanceOfTypeConstraint is used to test that an object
+ is of the same type provided or derived from it.
+
+
+
+ Construct an InstanceOfTypeConstraint for the type provided
+
+ The expected Type
+
+
+ Test whether an object is of the specified type or a derived type
+
+ The object to be tested
+ True if the object is of the provided type or derives from it, otherwise false.
+
+
+ Write a description of this constraint to a MessageWriter
+
+ The MessageWriter to use
+
+
+ AssignableFromConstraint is used to test that an object
+ can be assigned from a given Type.
+
+
+
+ Construct an AssignableFromConstraint for the type provided
+
+
+
+
+ Test whether an object can be assigned from the specified type
+
+ The object to be tested
+ True if the object can be assigned a value of the expected Type, otherwise false.
+
+
+ Write a description of this constraint to a MessageWriter
+
+ The MessageWriter to use
+
+
+ AssignableToConstraint is used to test that an object
+ can be assigned to a given Type.
+
+
+
+ Construct an AssignableToConstraint for the type provided
+
+
+
+
+ Test whether an object can be assigned to the specified type
+
+ The object to be tested
+ True if the object can be assigned a value of the expected Type, otherwise false.
+
+
+ Write a description of this constraint to a MessageWriter
+
+ The MessageWriter to use
+
+
+ Static helper class used in the constraint-based syntax
+
+
+
+ Creates a new SubstringConstraint
+
+ The value of the substring
+ A SubstringConstraint
+
+
+ Creates a new CollectionContainsConstraint.
+
+ The item that should be found.
+ A new CollectionContainsConstraint
+
+
+ Summary description for DirectoryAssert
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+ We don't actually want any instances of this object, but some people
+ like to inherit from it to add other static methods. Hence, the
+ protected constructor disallows any instances of this object.
+
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+ The message to display if directories are not equal
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+ The message to display if directories are not equal
+
+
+ Verifies that two directories are equal. Two directories are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+ The message to display if directories are not equal
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory containing the value that is expected
+ A directory containing the actual value
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+ The message to display if directories are equal
+ Arguments to be used in formatting the message
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+ The message to display if directories are equal
+
+
+ Asserts that two directories are not equal. If they are equal
+ an is thrown.
+
+ A directory path string containing the value that is expected
+ A directory path string containing the actual value
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+
+
+ Asserts that the directory is empty. If it is not empty
+ an is thrown.
+
+ A directory to search
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+ Arguments to be used in formatting the message
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+ The message to display if directories are not equal
+
+
+ Asserts that the directory is not empty. If it is empty
+ an is thrown.
+
+ A directory to search
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+ Arguments to be used in formatting the message
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+ Arguments to be used in formatting the message
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+
+
+ Asserts that path contains actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+ Arguments to be used in formatting the message
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+ Arguments to be used in formatting the message
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+ The message to display if directory is not within the path
+
+
+ Asserts that path does not contain actual as a subdirectory or
+ an is thrown.
+
+ A directory to search
+ sub-directory asserted to exist under directory
+
+
+ Thrown when an assertion failed.
+
+
+ The error message that explains
+ the reason for the exception
+
+ The error message that explains
+ the reason for the exception
+ The exception that caused the
+ current exception
+
+
+ Serialization Constructor
+
+
+
+ Thrown when an assertion failed.
+
+
+
+
+ The error message that explains
+ the reason for the exception
+ The exception that caused the
+ current exception
+
+
+ Serialization Constructor
+
+
+
+ Thrown when a test executes inconclusively.
+
+
+ The error message that explains
+ the reason for the exception
+
+ The error message that explains
+ the reason for the exception
+ The exception that caused the
+ current exception
+
+
+ Serialization Constructor
+
+
+
+ Thrown when an assertion failed.
+
+
+
+
+ The error message that explains
+ the reason for the exception
+ The exception that caused the
+ current exception
+
+
+ Serialization Constructor
+
+
+
+ Summary description for FileAssert.
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+ We don't actually want any instances of this object, but some people
+ like to inherit from it to add other static methods. Hence, the
+ protected constructor disallows any instances of this object.
+
+
+
+ Verifies that two Streams are equal. Two Streams are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The expected Stream
+ The actual Stream
+ The message to display if Streams are not equal
+ Arguments to be used in formatting the message
+
+
+ Verifies that two Streams are equal. Two Streams are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The expected Stream
+ The actual Stream
+ The message to display if objects are not equal
+
+
+ Verifies that two Streams are equal. Two Streams are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The expected Stream
+ The actual Stream
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+ The message to display if Streams are not equal
+ Arguments to be used in formatting the message
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+ The message to display if objects are not equal
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+ The message to display if Streams are not equal
+ Arguments to be used in formatting the message
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+ The message to display if objects are not equal
+
+
+ Verifies that two files are equal. Two files are considered
+ equal if both are null, or if both have the same value byte for byte.
+ If they are not equal an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+
+
+ Asserts that two Streams are not equal. If they are equal
+ an is thrown.
+
+ The expected Stream
+ The actual Stream
+ The message to be displayed when the two Stream are the same.
+ Arguments to be used in formatting the message
+
+
+ Asserts that two Streams are not equal. If they are equal
+ an is thrown.
+
+ The expected Stream
+ The actual Stream
+ The message to be displayed when the Streams are the same.
+
+
+ Asserts that two Streams are not equal. If they are equal
+ an is thrown.
+
+ The expected Stream
+ The actual Stream
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+ The message to display if Streams are not equal
+ Arguments to be used in formatting the message
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+ The message to display if objects are not equal
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ A file containing the value that is expected
+ A file containing the actual value
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+ The message to display if Streams are not equal
+ Arguments to be used in formatting the message
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+ The message to display if objects are not equal
+
+
+ Asserts that two files are not equal. If they are equal
+ an is thrown.
+
+ The path to a file containing the value that is expected
+ The path to a file containing the actual value
+
+
+ GlobalSettings is a place for setting default values used
+ by the framework in performing asserts.
+
+
+
+ Default tolerance for floating point equality
+
+
+
+ Helper class with properties and methods that supply
+ a number of constraints used in Asserts.
+
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them succeed.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if at least one of them succeeds.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them fail.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding only if a specified number of them succeed.
+
+
+
+ Returns a new PropertyConstraintExpression, which will either
+ test for the existence of the named property on the object
+ being tested or apply any following constraint to that property.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Length property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Count property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the Message property of the object being tested.
+
+
+
+ Returns a new ConstraintExpression, which will apply the following
+ constraint to the InnerException property of the object being tested.
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+ Returns a new AttributeConstraint checking for the
+ presence of a particular attribute on an object.
+
+
+
+ Returns a new CollectionContainsConstraint checking for the
+ presence of a particular object in the collection.
+
+
+
+
+
+
+ Compares two objects for equality within a tolerance
+
+ The first object to compare
+ The second object to compare
+ The tolerance to use in the comparison
+
+
+
+
+
+
+
+ Compares two objects of a given Type for equality within a tolerance
+
+ The first object to compare
+ The second object to compare
+ The tolerance to use in the comparison
+
+
+
+ When implemented by an attribute, this interface implemented to provide actions to execute before and after tests.
+
+
+
+ Executed before each test is run
+
+ Provides details about the test that is going to be run.
+
+
+ Executed after each test is run
+
+ Provides details about the test that has just been run.
+
+
+ Provides the target for the action attribute
+
+ The target for the action attribute
+
+
+ Interface implemented by a user fixture in order to
+ validate any expected exceptions. It is only called
+ for test methods marked with the ExpectedException
+ attribute.
+
+
+
+ Method to handle an expected exception
+
+ The exception to be handled
+
+
+ Provides details about a test
+
+
+
+ Creates an instance of TestDetails
+
+ The fixture that the test is a member of, if available.
+ The method that implements the test, if available.
+ The full name of the test.
+ A string representing the type of test, e.g. "Test Case".
+ Indicates if the test represents a suite of tests.
+
+
+ The fixture that the test is a member of, if available.
+
+
+
+ The method that implements the test, if available.
+
+
+
+ The full name of the test.
+
+
+
+ A string representing the type of test, e.g. "Test Case".
+
+
+
+ Indicates if the test represents a suite of tests.
+
+
+
+ Helper class with properties and methods that supply
+ a number of constraints used in Asserts.
+
+
+
+ Returns a ConstraintExpression that negates any
+ following constraint.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them succeed.
+
+
+
+ Returns a constraint that tests for null
+
+
+
+ Returns a constraint that tests for True
+
+
+
+ Returns a constraint that tests for False
+
+
+
+ Returns a constraint that tests for a positive value
+
+
+
+ Returns a constraint that tests for a negative value
+
+
+
+ Returns a constraint that tests for NaN
+
+
+
+ Returns a constraint that tests for empty
+
+
+
+ Returns a constraint that tests whether a collection
+ contains all unique items.
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in binary format.
+
+
+
+ Returns a constraint that tests whether an object graph is serializable in xml format.
+
+
+
+ Returns a constraint that tests two items for equality
+
+
+
+ Returns a constraint that tests that two references are the same object
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is greater than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the
+ actual value is less than or equal to the suppled argument
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual
+ value is of the exact type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is of the type supplied as an argument or a derived type.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is assignable from the type supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a collection containing the same elements as the
+ collection supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the actual value
+ is a subset of the collection supplied as an argument.
+
+
+
+ Returns a constraint that tests whether a collection is ordered
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the Regex pattern supplied as an argument.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same as an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same path or under an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the path provided
+ is the same path or under an expected path after canonicalization.
+
+
+
+ Returns a constraint that tests whether the actual value falls
+ within a specified range.
+
+
+
+ The ITestCaseData interface is implemented by a class
+ that is able to return complete testcases for use by
+ a parameterized test method.
+ NOTE: This interface is used in both the framework
+ and the core, even though that results in two different
+ types. However, sharing the source code guarantees that
+ the various implementations will be compatible and that
+ the core is able to reflect successfully over the
+ framework implementations of ITestCaseData.
+
+
+
+ Gets the argument list to be provided to the test
+
+
+
+ Gets the expected result
+
+
+
+ Indicates whether a result has been specified.
+ This is necessary because the result may be
+ null, so it's value cannot be checked.
+
+
+
+ Gets the expected exception Type
+
+
+
+ Gets the FullName of the expected exception
+
+
+
+ Gets the name to be used for the test
+
+
+
+ Gets the description of the test
+
+
+
+ Gets a value indicating whether this is ignored.
+
+ true if ignored; otherwise, false.
+
+
+ Gets a value indicating whether this is explicit.
+
+ true if explicit; otherwise, false.
+
+
+ Gets the ignore reason.
+
+ The ignore reason.
+
+
+ The Iz class is a synonym for Is intended for use in VB,
+ which regards Is as a keyword.
+
+
+
+ The List class is a helper class with properties and methods
+ that supply a number of constraints used with lists and collections.
+
+
+
+ List.Map returns a ListMapper, which can be used to map
+ the original collection to another collection.
+
+
+
+
+
+ ListMapper is used to transform a collection used as an actual argument
+ producing another collection to be used in the assertion.
+
+
+
+ Construct a ListMapper based on a collection
+
+ The collection to be transformed
+
+
+ Produces a collection containing all the values of a property
+
+ The collection of property values
+
+
+
+ Randomizer returns a set of random values in a repeatable
+ way, to allow re-running of tests if necessary.
+
+
+
+ Get a random seed for use in creating a randomizer.
+
+
+
+ Get a randomizer for a particular member, returning
+ one that has already been created if it exists.
+ This ensures that the same values are generated
+ each time the tests are reloaded.
+
+
+
+ Get a randomizer for a particular parameter, returning
+ one that has already been created if it exists.
+ This ensures that the same values are generated
+ each time the tests are reloaded.
+
+
+
+ Construct a randomizer using a random seed
+
+
+
+ Construct a randomizer using a specified seed
+
+
+
+ Return an array of random doubles between 0.0 and 1.0.
+
+
+
+
+
+ Return an array of random doubles with values in a specified range.
+
+
+
+ Return an array of random ints with values in a specified range.
+
+
+
+ The SpecialValue enum is used to represent TestCase arguments
+ that cannot be used as arguments to an Attribute.
+
+
+
+ Null represents a null value, which cannot be used as an
+ argument to an attriute under .NET 1.x
+
+
+
+ Basic Asserts on strings.
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+
+
+
+
+ Asserts that a string is found within another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that a string is found within another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+ Asserts that a string is found within another string.
+
+ The expected string
+ The string to be examined
+
+
+ Asserts that a string is not found within another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that a string is found within another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+ Asserts that a string is found within another string.
+
+ The expected string
+ The string to be examined
+
+
+ Asserts that a string starts with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that a string starts with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+ Asserts that a string starts with another string.
+
+ The expected string
+ The string to be examined
+
+
+ Asserts that a string does not start with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that a string does not start with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+ Asserts that a string does not start with another string.
+
+ The expected string
+ The string to be examined
+
+
+ Asserts that a string ends with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that a string ends with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+ Asserts that a string ends with another string.
+
+ The expected string
+ The string to be examined
+
+
+ Asserts that a string does not end with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that a string does not end with another string.
+
+ The expected string
+ The string to be examined
+ The message to display in case of failure
+
+
+ Asserts that a string does not end with another string.
+
+ The expected string
+ The string to be examined
+
+
+ Asserts that two strings are equal, without regard to case.
+
+ The expected string
+ The actual string
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that two strings are equal, without regard to case.
+
+ The expected string
+ The actual string
+ The message to display in case of failure
+
+
+ Asserts that two strings are equal, without regard to case.
+
+ The expected string
+ The actual string
+
+
+ Asserts that two strings are not equal, without regard to case.
+
+ The expected string
+ The actual string
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that two strings are Notequal, without regard to case.
+
+ The expected string
+ The actual string
+ The message to display in case of failure
+
+
+ Asserts that two strings are not equal, without regard to case.
+
+ The expected string
+ The actual string
+
+
+ Asserts that a string matches an expected regular expression pattern.
+
+ The regex pattern to be matched
+ The actual string
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that a string matches an expected regular expression pattern.
+
+ The regex pattern to be matched
+ The actual string
+ The message to display in case of failure
+
+
+ Asserts that a string matches an expected regular expression pattern.
+
+ The regex pattern to be matched
+ The actual string
+
+
+ Asserts that a string does not match an expected regular expression pattern.
+
+ The regex pattern to be used
+ The actual string
+ The message to display in case of failure
+ Arguments used in formatting the message
+
+
+ Asserts that a string does not match an expected regular expression pattern.
+
+ The regex pattern to be used
+ The actual string
+ The message to display in case of failure
+
+
+ Asserts that a string does not match an expected regular expression pattern.
+
+ The regex pattern to be used
+ The actual string
+
+
+ The TestCaseData class represents a set of arguments
+ and other parameter info to be used for a parameterized
+ test case. It provides a number of instance modifiers
+ for use in initializing the test case.
+ Note: Instance modifiers are getters that return
+ the same instance after modifying it's state.
+
+
+
+ The argument list to be provided to the test
+
+
+
+ The expected result to be returned
+
+
+
+ Set to true if this has an expected result
+
+
+
+ The expected exception Type
+
+
+
+ The FullName of the expected exception
+
+
+
+ The name to be used for the test
+
+
+
+ The description of the test
+
+
+
+ A dictionary of properties, used to add information
+ to tests without requiring the class to change.
+
+
+
+ If true, indicates that the test case is to be ignored
+
+
+
+ If true, indicates that the test case is marked explicit
+
+
+
+ The reason for ignoring a test case
+
+
+
+ Initializes a new instance of the class.
+
+ The arguments.
+
+
+ Initializes a new instance of the class.
+
+ The argument.
+
+
+ Initializes a new instance of the class.
+
+ The first argument.
+ The second argument.
+
+
+ Initializes a new instance of the class.
+
+ The first argument.
+ The second argument.
+ The third argument.
+
+
+ Gets the argument list to be provided to the test
+
+
+
+ Gets the expected result
+
+
+
+ Returns true if the result has been set
+
+
+
+ Gets the expected exception Type
+
+
+
+ Gets the FullName of the expected exception
+
+
+
+ Gets the name to be used for the test
+
+
+
+ Gets the description of the test
+
+
+
+ Gets a value indicating whether this is ignored.
+
+ true if ignored; otherwise, false.
+
+
+ Gets a value indicating whether this is explicit.
+
+ true if explicit; otherwise, false.
+
+
+ Gets the ignore reason.
+
+ The ignore reason.
+
+
+ Gets a list of categories associated with this test.
+
+
+
+ Gets the property dictionary for this test
+
+
+
+ Sets the expected result for the test
+
+ The expected result
+ A modified TestCaseData
+
+
+ Sets the expected exception type for the test
+
+ Type of the expected exception.
+ The modified TestCaseData instance
+
+
+ Sets the expected exception type for the test
+
+ FullName of the expected exception.
+ The modified TestCaseData instance
+
+
+ Sets the name of the test case
+
+ The modified TestCaseData instance
+
+
+ Sets the description for the test case
+ being constructed.
+
+ The description.
+ The modified TestCaseData instance.
+
+
+ Applies a category to the test
+
+
+
+
+
+ Applies a named property to the test
+
+
+
+
+
+
+ Applies a named property to the test
+
+
+
+
+
+
+ Applies a named property to the test
+
+
+
+
+
+
+ Ignores this TestCase.
+
+
+
+
+ Ignores this TestCase, specifying the reason.
+
+ The reason.
+
+
+
+ Marks this TestCase as Explicit
+
+
+
+
+ Marks this TestCase as Explicit, specifying the reason.
+
+ The reason.
+
+
+
+ Provide the context information of the current test
+
+
+
+ Constructs a TestContext using the provided context dictionary
+
+ A context dictionary
+
+
+ Get the current test context. This is created
+ as needed. The user may save the context for
+ use within a test, but it should not be used
+ outside the test for which it is created.
+
+
+
+ Gets a TestAdapter representing the currently executing test in this context.
+
+
+
+ Gets a ResultAdapter representing the current result for the test
+ executing in this context.
+
+
+
+ Gets the directory containing the current test assembly.
+
+
+
+ Gets the directory to be used for outputing files created
+ by this test run.
+
+
+
+ TestAdapter adapts a Test for consumption by
+ the user test code.
+
+
+
+ Constructs a TestAdapter for this context
+
+ The context dictionary
+
+
+ The name of the test.
+
+
+
+ The FullName of the test
+
+
+
+ The properties of the test.
+
+
+
+ ResultAdapter adapts a TestResult for consumption by
+ the user test code.
+
+
+
+ Construct a ResultAdapter for a context
+
+ The context holding the result
+
+
+ The TestState of current test. This maps to the ResultState
+ used in nunit.core and is subject to change in the future.
+
+
+
+ The TestStatus of current test. This enum will be used
+ in future versions of NUnit and so is to be preferred
+ to the TestState value.
+
+
+
+ The ResultState enum indicates the result of running a test
+
+
+
+ The result is inconclusive
+
+
+
+ The test was not runnable.
+
+
+
+ The test has been skipped.
+
+
+
+ The test has been ignored.
+
+
+
+ The test succeeded
+
+
+
+ The test failed
+
+
+
+ The test encountered an unexpected exception
+
+
+
+ The test was cancelled by the user
+
+
+
+ The TestStatus enum indicates the result of running a test
+
+
+
+ The test was inconclusive
+
+
+
+ The test has skipped
+
+
+
+ The test succeeded
+
+
+
+ The test failed
+
+
+
+ Helper class with static methods used to supply constraints
+ that operate on strings.
+
+
+
+ Returns a ConstraintExpression, which will apply
+ the following constraint to all members of a collection,
+ succeeding if all of them succeed.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value contains the substring supplied as an argument.
+
+
+
+ Returns a constraint that fails if the actual
+ value contains the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+ Returns a constraint that fails if the actual
+ value starts with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+ Returns a constraint that fails if the actual
+ value ends with the substring supplied as an argument.
+
+
+
+ Returns a constraint that succeeds if the actual
+ value matches the Regex pattern supplied as an argument.
+
+
+
+ Returns a constraint that fails if the actual
+ value matches the pattern supplied as an argument.
+
+
+
+ TextMessageWriter writes constraint descriptions and messages
+ in displayable form as a text stream. It tailors the display
+ of individual message components to form the standard message
+ format of NUnit assertion failure messages.
+
+
+
+ Prefix used for the expected value line of a message
+
+
+
+ Prefix used for the actual value line of a message
+
+
+
+ Length of a message prefix
+
+
+
+ Construct a TextMessageWriter
+
+
+
+ Construct a TextMessageWriter, specifying a user message
+ and optional formatting arguments.
+
+
+
+
+
+ Gets or sets the maximum line length for this writer
+
+
+
+ Method to write single line message with optional args, usually
+ written to precede the general failure message, at a givel
+ indentation level.
+
+ The indentation level of the message
+ The message to be written
+ Any arguments used in formatting the message
+
+
+ Display Expected and Actual lines for a constraint. This
+ is called by MessageWriter's default implementation of
+ WriteMessageTo and provides the generic two-line display.
+
+ The constraint that failed
+
+
+ Display Expected and Actual lines for given values. This
+ method may be called by constraints that need more control over
+ the display of actual and expected values than is provided
+ by the default implementation.
+
+ The expected value
+ The actual value causing the failure
+
+
+ Display Expected and Actual lines for given values, including
+ a tolerance value on the expected line.
+
+ The expected value
+ The actual value causing the failure
+ The tolerance within which the test was made
+
+
+ Display the expected and actual string values on separate lines.
+ If the mismatch parameter is >=0, an additional line is displayed
+ line containing a caret that points to the mismatch point.
+
+ The expected string value
+ The actual string value
+ The point at which the strings don't match or -1
+ If true, case is ignored in string comparisons
+ If true, clip the strings to fit the max line length
+
+
+ Writes the text for a connector.
+
+ The connector.
+
+
+ Writes the text for a predicate.
+
+ The predicate.
+
+
+ Write the text for a modifier.
+
+ The modifier.
+
+
+ Writes the text for an expected value.
+
+ The expected value.
+
+
+ Writes the text for an actual value.
+
+ The actual value.
+
+
+ Writes the text for a generalized value.
+
+ The value.
+
+
+ Writes the text for a collection value,
+ starting at a particular point, to a max length
+
+ The collection containing elements to write.
+ The starting point of the elements to write
+ The maximum number of elements to write
+
+
+ Write the generic 'Expected' line for a constraint
+
+ The constraint that failed
+
+
+ Write the generic 'Expected' line for a given value
+
+ The expected value
+
+
+ Write the generic 'Expected' line for a given value
+ and tolerance.
+
+ The expected value
+ The tolerance within which the test was made
+
+
+ Write the generic 'Actual' line for a constraint
+
+ The constraint for which the actual value is to be written
+
+
+ Write the generic 'Actual' line for a given value
+
+ The actual value causing a failure
+
+
+ Helper class with properties and methods that supply
+ constraints that operate on exceptions.
+
+
+
+ Creates a constraint specifying an expected exception
+
+
+
+ Creates a constraint specifying an exception with a given InnerException
+
+
+
+ Creates a constraint specifying an expected TargetInvocationException
+
+
+
+ Creates a constraint specifying an expected TargetInvocationException
+
+
+
+ Creates a constraint specifying an expected TargetInvocationException
+
+
+
+ Creates a constraint specifying that no exception is thrown
+
+
+
+ Creates a constraint specifying the exact type of exception expected
+
+
+
+ Creates a constraint specifying the exact type of exception expected
+
+
+
+ Creates a constraint specifying the type of exception expected
+
+
+
+ Creates a constraint specifying the type of exception expected
+
+
+
diff --git a/frameworks/csharp/nunit/framework/nunit.mocks.dll b/frameworks/csharp/nunit/framework/nunit.mocks.dll
new file mode 100755
index 00000000..3da00859
Binary files /dev/null and b/frameworks/csharp/nunit/framework/nunit.mocks.dll differ
diff --git a/frameworks/csharp/nunit/launcher.log.conf b/frameworks/csharp/nunit/launcher.log.conf
new file mode 100644
index 00000000..6a9ced8b
--- /dev/null
+++ b/frameworks/csharp/nunit/launcher.log.conf
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Circles/Failure.jpg b/frameworks/csharp/nunit/lib/Images/Tree/Circles/Failure.jpg
new file mode 100644
index 00000000..c245548b
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Circles/Failure.jpg differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Circles/Ignored.jpg b/frameworks/csharp/nunit/lib/Images/Tree/Circles/Ignored.jpg
new file mode 100644
index 00000000..0549b705
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Circles/Ignored.jpg differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Circles/Inconclusive.jpg b/frameworks/csharp/nunit/lib/Images/Tree/Circles/Inconclusive.jpg
new file mode 100644
index 00000000..8d36153c
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Circles/Inconclusive.jpg differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Circles/Skipped.jpg b/frameworks/csharp/nunit/lib/Images/Tree/Circles/Skipped.jpg
new file mode 100644
index 00000000..3d84255c
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Circles/Skipped.jpg differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Circles/Success.jpg b/frameworks/csharp/nunit/lib/Images/Tree/Circles/Success.jpg
new file mode 100644
index 00000000..15ec1b7f
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Circles/Success.jpg differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Classic/Failure.jpg b/frameworks/csharp/nunit/lib/Images/Tree/Classic/Failure.jpg
new file mode 100644
index 00000000..658905fd
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Classic/Failure.jpg differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Classic/Ignored.jpg b/frameworks/csharp/nunit/lib/Images/Tree/Classic/Ignored.jpg
new file mode 100644
index 00000000..95b7fdbd
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Classic/Ignored.jpg differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Classic/Inconclusive.jpg b/frameworks/csharp/nunit/lib/Images/Tree/Classic/Inconclusive.jpg
new file mode 100644
index 00000000..32a0ff72
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Classic/Inconclusive.jpg differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Classic/Skipped.jpg b/frameworks/csharp/nunit/lib/Images/Tree/Classic/Skipped.jpg
new file mode 100644
index 00000000..3d84255c
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Classic/Skipped.jpg differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Classic/Success.jpg b/frameworks/csharp/nunit/lib/Images/Tree/Classic/Success.jpg
new file mode 100644
index 00000000..3d8e7609
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Classic/Success.jpg differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Default/Failure.png b/frameworks/csharp/nunit/lib/Images/Tree/Default/Failure.png
new file mode 100644
index 00000000..2e400b27
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Default/Failure.png differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Default/Ignored.png b/frameworks/csharp/nunit/lib/Images/Tree/Default/Ignored.png
new file mode 100644
index 00000000..05715cbb
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Default/Ignored.png differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Default/Inconclusive.png b/frameworks/csharp/nunit/lib/Images/Tree/Default/Inconclusive.png
new file mode 100644
index 00000000..4807b7ce
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Default/Inconclusive.png differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Default/Skipped.png b/frameworks/csharp/nunit/lib/Images/Tree/Default/Skipped.png
new file mode 100644
index 00000000..7c9fc64e
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Default/Skipped.png differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Default/Success.png b/frameworks/csharp/nunit/lib/Images/Tree/Default/Success.png
new file mode 100644
index 00000000..2a301508
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Default/Success.png differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Visual Studio/Failure.png b/frameworks/csharp/nunit/lib/Images/Tree/Visual Studio/Failure.png
new file mode 100644
index 00000000..ba03e848
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Visual Studio/Failure.png differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Visual Studio/Ignored.png b/frameworks/csharp/nunit/lib/Images/Tree/Visual Studio/Ignored.png
new file mode 100644
index 00000000..9271d6e7
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Visual Studio/Ignored.png differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Visual Studio/Inconclusive.png b/frameworks/csharp/nunit/lib/Images/Tree/Visual Studio/Inconclusive.png
new file mode 100644
index 00000000..76219b5c
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Visual Studio/Inconclusive.png differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Visual Studio/Skipped.png b/frameworks/csharp/nunit/lib/Images/Tree/Visual Studio/Skipped.png
new file mode 100644
index 00000000..7c9fc64e
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Visual Studio/Skipped.png differ
diff --git a/frameworks/csharp/nunit/lib/Images/Tree/Visual Studio/Success.png b/frameworks/csharp/nunit/lib/Images/Tree/Visual Studio/Success.png
new file mode 100644
index 00000000..346fe8f9
Binary files /dev/null and b/frameworks/csharp/nunit/lib/Images/Tree/Visual Studio/Success.png differ
diff --git a/frameworks/csharp/nunit/lib/nunit-console-runner.dll b/frameworks/csharp/nunit/lib/nunit-console-runner.dll
new file mode 100755
index 00000000..0b58cbeb
Binary files /dev/null and b/frameworks/csharp/nunit/lib/nunit-console-runner.dll differ
diff --git a/frameworks/csharp/nunit/lib/nunit-gui-runner.dll b/frameworks/csharp/nunit/lib/nunit-gui-runner.dll
new file mode 100755
index 00000000..34a134a6
Binary files /dev/null and b/frameworks/csharp/nunit/lib/nunit-gui-runner.dll differ
diff --git a/frameworks/csharp/nunit/lib/nunit.core.dll b/frameworks/csharp/nunit/lib/nunit.core.dll
new file mode 100755
index 00000000..e0280a0a
Binary files /dev/null and b/frameworks/csharp/nunit/lib/nunit.core.dll differ
diff --git a/frameworks/csharp/nunit/lib/nunit.core.interfaces.dll b/frameworks/csharp/nunit/lib/nunit.core.interfaces.dll
new file mode 100755
index 00000000..6fb27f79
Binary files /dev/null and b/frameworks/csharp/nunit/lib/nunit.core.interfaces.dll differ
diff --git a/frameworks/csharp/nunit/lib/nunit.core.interfaces.xml b/frameworks/csharp/nunit/lib/nunit.core.interfaces.xml
new file mode 100644
index 00000000..f560461d
--- /dev/null
+++ b/frameworks/csharp/nunit/lib/nunit.core.interfaces.xml
@@ -0,0 +1,2571 @@
+
+
+
+ nunit.core.interfaces
+
+
+
+
+ The ITestCaseData interface is implemented by a class
+ that is able to return complete testcases for use by
+ a parameterized test method.
+ NOTE: This interface is used in both the framework
+ and the core, even though that results in two different
+ types. However, sharing the source code guarantees that
+ the various implementations will be compatible and that
+ the core is able to reflect successfully over the
+ framework implementations of ITestCaseData.
+
+
+
+ Gets the argument list to be provided to the test
+
+
+
+ Gets the expected result
+
+
+
+ Indicates whether a result has been specified.
+ This is necessary because the result may be
+ null, so it's value cannot be checked.
+
+
+
+ Gets the expected exception Type
+
+
+
+ Gets the FullName of the expected exception
+
+
+
+ Gets the name to be used for the test
+
+
+
+ Gets the description of the test
+
+
+
+ Gets a value indicating whether this is ignored.
+
+ true if ignored; otherwise, false.
+
+
+ Gets a value indicating whether this is explicit.
+
+ true if explicit; otherwise, false.
+
+
+ Gets the ignore reason.
+
+ The ignore reason.
+
+
+ The EventListener interface is used within the NUnit core to receive
+ notifications of significant events while a test is being run. These
+ events are propogated to any client, which may choose to convert them
+ to .NET events or to use them directly.
+
+
+
+ Called when a test run is starting
+
+ The name of the test being started
+ The number of test cases under this test
+
+
+ Called when a run finishes normally
+
+ The result of the test
+
+
+ Called when a run is terminated due to an exception
+
+ Exception that was thrown
+
+
+ Called when a test case is starting
+
+ The name of the test case
+
+
+ Called when a test case has finished
+
+ The result of the test
+
+
+ Called when a suite is starting
+
+ The name of the suite
+
+
+ Called when a suite has finished
+
+ The result of the suite
+
+
+ Called when an unhandled exception is detected during
+ the execution of a test run.
+
+ The exception thta was detected
+
+
+ Called when the test direts output to the console.
+
+ A console message
+
+
+ The Addin class holds information about an addin.
+
+
+
+ Construct an Addin for a type.
+
+ The type to be used
+
+
+ The name of the Addin
+
+
+
+ Brief description of what the Addin does
+
+
+
+ The type or types of extension provided, using
+ one or more members of the ExtensionType enumeration.
+
+
+
+ The AssemblyQualifiedName of the type that implements
+ the addin.
+
+
+
+ The status of the addin
+
+
+
+ Any message that clarifies the status of the Addin,
+ such as an error message or an explanation of why
+ the addin is disabled.
+
+
+
+ Return true if two Addins have teh same type name
+
+ The other addin to be compared
+
+
+ Return a hash code for this addin
+
+
+
+ The AddinStatus enum indicates the load status of an addin.
+
+
+
+ Not known - default
+
+
+
+ The addin is enabled but not loaded
+
+
+
+ The addin is disabled
+
+
+
+ The addin was loaded successfully
+
+
+
+ An error was encountered loading the addin
+
+
+
+ The ExtensionType enumeration is used to indicate the
+ kinds of extensions provided by an Addin. The addin
+ is only installed by hosts supporting one of its
+ extension types.
+
+
+
+ A Core extension is installed by the CoreExtensions
+ host in each test domain.
+
+
+
+ A Client extension is installed by all clients
+
+
+
+ A Gui extension is installed by the gui client
+
+
+
+ Add-ins are used to extend NUnti. All add-ins must
+ implement the IAddin interface.
+
+
+
+ When called, the add-in installs itself into
+ the host, if possible. Because NUnit uses separate
+ hosts for the client and test domain environments,
+ an add-in may be invited to istall itself more than
+ once. The add-in is responsible for checking which
+ extension points are supported by the host that is
+ passed to it and taking the appropriate action.
+
+ The host in which to install the add-in
+ True if the add-in was installed, otehrwise false
+
+
+ The IAddinRegistry interface allows registering addins
+ and retrieving information about them. It is also used
+ to record the load status of an addin.
+
+
+
+ Gets a list of all addins as Addin objects
+
+
+
+ Registers an addin
+
+ The addin to be registered
+
+
+ Returns true if an addin of a given name is registered
+
+ The name of the addin
+ True if an addin of that name is registered, otherwise false
+
+
+ Sets the load status of an addin
+
+ The name of the addin
+ The status to be set
+ An optional message explaining the status
+
+
+ The IDataPointProvider interface is used by extensions
+ that provide data for a single test parameter.
+
+
+
+ Determine whether any data is available for a parameter.
+
+ A ParameterInfo representing one
+ argument to a parameterized test
+ True if any data is available, otherwise false.
+
+
+ Return an IEnumerable providing data for use with the
+ supplied parameter.
+
+ A ParameterInfo representing one
+ argument to a parameterized test
+ An IEnumerable providing the required data
+
+
+ The IDataPointProvider2 interface extends IDataPointProvider
+ by making the test fixture for which the test is being built
+ available for use.
+
+
+
+ Determine whether any data is available for a parameter.
+
+ A ParameterInfo representing one
+ argument to a parameterized test
+ The test suite for which the test is being built
+ True if any data is available, otherwise false.
+
+
+ Return an IEnumerable providing data for use with the
+ supplied parameter.
+
+ A ParameterInfo representing one
+ argument to a parameterized test
+ The test suite for which the test is being built
+ An IEnumerable providing the required data
+
+
+ The IExtensionHost interface is implemented by each
+ of NUnit's Extension hosts. Currently, there is
+ only one host, which resides in the test domain.
+
+
+
+ Get a list of the ExtensionPoints provided by this host.
+
+
+
+ Get an interface to the framework registry
+
+
+
+ Return an extension point by name, if present
+
+ The name of the extension point
+ The extension point, if found, otherwise null
+
+
+ Gets the ExtensionTypes supported by this host
+
+ An enum indicating the ExtensionTypes supported
+
+
+ Represents a single point of extension for NUnit. Some extension
+ points may accept only a single extension, while others may
+ accept more than one at the same time.
+
+
+
+ Get the name of this extension point
+
+
+
+ Get the host that provides this extension point
+
+
+
+ Install an extension at this extension point. If the
+ extension object does not meet the requirements for
+ this extension point, an exception is thrown.
+
+ The extension to install
+
+
+ Removes an extension from this extension point. If the
+ extension object is not present, the method returns
+ without error.
+
+
+
+
+ Represents a single point of extension for NUnit. Some extension
+ points may accept only a single extension, while others may
+ accept more than one at the same time. This interface enhances
+ IExtensionPoint by allowing specification of a priority
+ order for applying addins.
+
+
+
+ Install an extension at this extension point specifying
+ an integer priority value for the extension.If the
+ extension object does not meet the requirements for
+ this extension point, or if the extension point does
+ not support the requested priority level, an exception
+ is thrown.
+
+ The extension to install
+ The priority level for this extension
+
+
+ The IFrameworkRegistry allows extensions to register new
+ frameworks or emulations of other frameworks.
+
+
+
+ Register a framework
+
+ The name of the framework
+ The name of the assembly that the tests reference
+
+
+ The ISuiteBuilder interface is exposed by a class that knows how to
+ build a suite from one or more Types.
+
+
+
+ Examine the type and determine if it is suitable for
+ this builder to use in building a TestSuite.
+ Note that returning false will cause the type to be ignored
+ in loading the tests. If it is desired to load the suite
+ but label it as non-runnable, ignored, etc., then this
+ method must return true.
+
+ The type of the fixture to be used
+ True if the type can be used to build a TestSuite
+
+
+ Build a TestSuite from type provided.
+
+ The type of the fixture to be used
+ A TestSuite
+
+
+ The ITestCaseBuilder interface is exposed by a class that knows how to
+ build a test case from certain methods.
+
+
+
+ Examine the method and determine if it is suitable for
+ this builder to use in building a TestCase.
+ Note that returning false will cause the method to be ignored
+ in loading the tests. If it is desired to load the method
+ but label it as non-runnable, ignored, etc., then this
+ method must return true.
+
+ The test method to examine
+ True is the builder can use this method
+
+
+ Build a TestCase from the provided MethodInfo.
+
+ The method to be used as a test case
+ A TestCase or null
+
+
+ ITestCaseBuilder2 extends ITestCaseBuilder with methods
+ that include the suite for which the test case is being
+ built. Test case builders not needing the suite can
+ continue to implement ITestCaseBuilder.
+
+
+
+ Examine the method and determine if it is suitable for
+ this builder to use in building a TestCase to be
+ included in the suite being populated.
+ Note that returning false will cause the method to be ignored
+ in loading the tests. If it is desired to load the method
+ but label it as non-runnable, ignored, etc., then this
+ method must return true.
+
+ The test method to examine
+ The suite being populated
+ True is the builder can use this method
+
+
+ Build a TestCase from the provided MethodInfo for
+ inclusion in the suite being constructed.
+
+ The method to be used as a test case
+ The test suite being populated, or null
+ A TestCase or null
+
+
+ The ITestCaseProvider interface is used by extensions
+ that provide data for parameterized tests, along with
+ certain flags and other indicators used in the test.
+
+
+
+ Determine whether any test cases are available for a parameterized method.
+
+ A MethodInfo representing a parameterized test
+ True if any cases are available, otherwise false.
+
+
+ Return an IEnumerable providing test cases for use in
+ running a paramterized test.
+
+
+
+
+
+ ITestCaseProvider2 extends ITestCaseProvider with methods
+ that include the suite for which the test case is being
+ built. TestCaseProviders not needing the suite can
+ continue to implement ITestCaseBuilder.
+
+
+
+ Determine whether any test cases are available for a parameterized method.
+
+ A MethodInfo representing a parameterized test
+ The suite for which the test case is being built
+ True if any cases are available, otherwise false.
+
+
+ Return an IEnumerable providing test cases for use in
+ running a paramterized test.
+
+
+ The suite for which the test case is being built
+
+
+
+ DecoratorPriority wraps constants that may be used
+ to represent the relative priority of TestDecorators.
+ Decorators with a lower priority are applied first
+ so that higher priority decorators wrap them.
+ NOTE: This feature is subject to change.
+
+
+
+ The default priority, equivalent to Normal
+
+
+
+ Priority for Decorators that must apply first
+
+
+
+ Normal Decorator priority
+
+
+
+ Priority for Decorators that must apply last
+
+
+
+ The ITestDecorator interface is exposed by a class that knows how to
+ enhance the functionality of a test case or suite by decorating it.
+
+
+
+ Examine the a Test and either return it as is, modify it
+ or return a different TestCase.
+
+ The Test to be decorated
+ The MethodInfo used to construct the test
+ The resulting Test
+
+
+ NUnitAddinAttribute is used to mark all add-ins. The marked class
+ must implement the IAddin interface.
+
+
+
+ The name of this addin
+
+
+
+ A description for the addin
+
+
+
+ The type of extension provided
+
+
+
+ Default Constructor
+
+
+
+ ParameterSet encapsulates method arguments and
+ other selected parameters needed for constructing
+ a parameterized test case.
+
+
+
+ A dictionary of properties, used to add information
+ to tests without requiring the class to change.
+
+
+
+ The RunState for this set of parameters.
+
+
+
+ Holds any exception thrown by the parameter provider
+
+
+
+ The arguments to be used in running the test,
+ which must match the method signature.
+
+
+
+ The original arguments supplied by the user,
+ used for display purposes.
+
+
+
+ The Type of any exception that is expected.
+
+
+
+ The FullName of any exception that is expected
+
+
+
+ The Message of any exception that is expected
+
+
+
+ Gets or sets the type of match to be performed on the expected message
+
+
+
+ The expected result of the test, which
+ must match the method return type.
+
+
+
+ Returns true if an expected result has been
+ specified for this parameter set.
+
+
+
+ A description to be applied to this test case
+
+
+
+ A name to be used for this test case in lieu
+ of the standard generated name containing
+ the argument list.
+
+
+
+ Gets or sets a value indicating whether this is ignored.
+
+ true if ignored; otherwise, false.
+
+
+ Gets or sets a value indicating whether this is explicit.
+
+ true if explicit; otherwise, false.
+
+
+ Gets or sets the ignore reason.
+
+ The ignore reason.
+
+
+ Gets a list of categories associated with this test.
+
+
+
+ Gets the property dictionary for this test
+
+
+
+ Construct a non-runnable ParameterSet, specifying
+ the provider excetpion that made it invalid.
+
+
+
+ Construct an empty parameter set, which
+ defaults to being Runnable.
+
+
+
+ Constructs a ParameterSet from another object, accessing properties
+ by reflection. The object must expose at least an Arguments property
+ in order for the test to be runnable.
+
+
+
+
+ Summary description for TestFramework.
+
+
+
+ The name of the framework
+
+
+
+ The file name of the assembly that defines the framwork
+
+
+
+ Constructs a TestFramwork object given its name and assembly name.
+
+
+
+
+
+ Combines multiple filters so that a test must pass all
+ of them in order to pass this filter.
+
+
+
+ Constructs an empty AndFilter
+
+
+
+ Constructs an AndFilter from an array of filters
+
+
+
+
+ Adds a filter to the list of filters
+
+ The filter to be added
+
+
+ Return an array of the composing filters
+
+
+
+ Checks whether the AndFilter is matched by a test
+
+ The test to be matched
+ True if all the component filters pass, otherwise false
+
+
+ Checks whether the AndFilter is matched by a test
+
+ The test to be matched
+ True if all the component filters match, otherwise false
+
+
+ Return string representation of the filter.
+
+
+
+ CategoryFilter is able to select or exclude tests
+ based on their categories.
+
+
+
+ Construct an empty CategoryFilter
+
+
+
+ Construct a CategoryFilter using a single category name
+
+ A category name
+
+
+ Construct a CategoryFilter using an array of category names
+
+ An array of category names
+
+
+ Add a category name to the filter
+
+ A category name
+
+
+ Check whether the filter matches a test
+
+ The test to be matched
+
+
+
+ Return the string representation of a category filter
+
+
+
+
+ Gets the list of categories from this filter
+
+
+
+ Summary description for NameFilter.
+
+
+
+ Construct an empty NameFilter
+
+
+
+ Construct a NameFilter for a single TestName
+
+
+
+
+ Add a TestName to a NameFilter
+
+
+
+
+ Check if a test matches the filter
+
+ The test to match
+ True if it matches, false if not
+
+
+ NotFilter negates the operation of another filter
+
+
+
+ Construct a not filter on another filter. The topLevel
+ argument is used to trigger special handling when tests
+ are being excluded.
+
+ The filter to be negated
+
+
+ Construct a not filter on another filter. The topLevel
+ argument is used to trigger special handling when tests
+ are being excluded.
+
+ The filter to be negated
+ Indicates whether this is a top level NotFilter
+
+
+ Indicates whether this is a top-level NotFilter,
+ requiring special handling of Explicit
+
+
+
+ Gets the base filter
+
+
+
+ Check whether the filter matches a test
+
+ The test to be matched
+ True if it matches, otherwise false
+
+
+ Determine whether any descendant of the test matches the filter criteria.
+
+ The test to be matched
+ True if at least one descendant matches the filter criteria
+
+
+ Return string representation of the filter
+
+
+
+ Combines multiple filters so that a test must pass one
+ of them in order to pass this filter.
+
+
+
+ Constructs an empty OrFilter
+
+
+
+ Constructs an AndFilter from an array of filters
+
+
+
+
+ Adds a filter to the list of filters
+
+ The filter to be added
+
+
+ Return an array of the composing filters
+
+
+
+ Checks whether the OrFilter is matched by a test
+
+ The test to be matched
+ True if any of the component filters pass, otherwise false
+
+
+ Checks whether the OrFilter is matched by a test
+
+ The test to be matched
+ True if any of the component filters match, otherwise false
+
+
+ Return the string representation of an or filter
+
+
+
+
+ SimpleName filter selects tests based on their name
+
+
+
+ Construct an empty SimpleNameFilter
+
+
+
+ Construct a SimpleNameFilter for a single name
+
+ The name the filter will recognize.
+
+
+ Construct a SimpleNameFilter for an array of names
+
+ The names the filter will recognize.
+
+
+ Add a name to a SimpleNameFilter
+
+ The name to be added.
+
+
+ Add an array of names to a SimpleNameFilter
+
+ The name to be added.
+
+
+ Check whether the filter matches a test
+
+ The test to be matched
+ True if it matches, otherwise false
+
+
+ The IAgency interface is implemented by a TestAgency in
+ order to allow TestAgents to register with it.
+
+
+
+ Registers an agent with an agency
+
+
+
+
+ The IService interface is implemented by all Services.
+
+
+
+ Initialize the Service
+
+
+
+ Do any cleanup needed before terminating the service
+
+
+
+ Common interface supported by all representations
+ of a test. Only includes informational fields.
+ The Run method is specifically excluded to allow
+ for data-only representations of a test.
+
+
+
+ Gets the completely specified name of the test
+ encapsulated in a TestName object.
+
+
+
+ Gets the name of the class containing this test. Returns
+ null if the test is not associated with a class.
+
+
+
+ Gets the name of the method implementing this test.
+ Returns null if the test is not implemented as a method.
+
+
+
+ Gets a string representing the type of test, e.g.: "Test Case"
+
+
+
+ Indicates whether the test can be run using
+ the RunState enum.
+
+
+
+ Reason for not running the test, if applicable
+
+
+
+ Count of the test cases ( 1 if this is a test case )
+
+
+
+ Categories available for this test
+
+
+
+ Return the description field.
+
+
+
+ Return additional properties of the test
+
+
+
+ True if this is a suite
+
+
+
+ Gets the parent test of this test
+
+
+
+ For a test suite, the child tests or suites
+ Null if this is not a test suite
+
+
+
+ Count the test cases that pass a filter. The
+ result should match those that would execute
+ when passing the same filter to Run.
+
+ The filter to apply
+ The count of test cases
+
+
+ Interface to be implemented by filters applied to tests.
+ The filter applies when running the test, after it has been
+ loaded, since this is the only time an ITest exists.
+
+
+
+ Indicates whether this is the EmptyFilter
+
+
+
+ Determine if a particular test passes the filter criteria. Pass
+ may examine the parents and/or descendants of a test, depending
+ on the semantics of the particular filter
+
+ The test to which the filter is applied
+ True if the test passes the filter, otherwise false
+
+
+ Determine whether the test itself matches the filter criteria,
+ without examining either parents or descendants.
+
+ The test to which the filter is applied
+ True if the filter matches the any parent of the test
+
+
+ OSPlatform represents a particular operating system platform
+
+
+
+ Platform ID for Unix as defined by Microsoft .NET 2.0 and greater
+
+
+
+ Platform ID for Unix as defined by Mono
+
+
+
+ Get the OSPlatform under which we are currently running
+
+
+
+ Product Type Enumeration used for Windows
+
+
+
+ Product type is unknown or unspecified
+
+
+
+ Product type is Workstation
+
+
+
+ Product type is Domain Controller
+
+
+
+ Product type is Server
+
+
+
+ Construct from a platform ID and version
+
+
+
+ Construct from a platform ID, version and product type
+
+
+
+ Get the platform ID of this instance
+
+
+
+ Get the Version of this instance
+
+
+
+ Get the Product Type of this instance
+
+
+
+ Return true if this is a windows platform
+
+
+
+ Return true if this is a Unix or Linux platform
+
+
+
+ Return true if the platform is Win32S
+
+
+
+ Return true if the platform is Win32Windows
+
+
+
+ Return true if the platform is Win32NT
+
+
+
+ Return true if the platform is Windows CE
+
+
+
+ Return true if the platform is Xbox
+
+
+
+ Return true if the platform is MacOSX
+
+
+
+ Return true if the platform is Windows 95
+
+
+
+ Return true if the platform is Windows 98
+
+
+
+ Return true if the platform is Windows ME
+
+
+
+ Return true if the platform is NT 3
+
+
+
+ Return true if the platform is NT 4
+
+
+
+ Return true if the platform is NT 5
+
+
+
+ Return true if the platform is Windows 2000
+
+
+
+ Return true if the platform is Windows XP
+
+
+
+ Return true if the platform is Windows 2003 Server
+
+
+
+ Return true if the platform is NT 6
+
+
+
+ Return true if the platform is Vista
+
+
+
+ Return true if the platform is Windows 2008 Server (original or R2)
+
+
+
+ Return true if the platform is Windows 2008 Server (original)
+
+
+
+ Return true if the platform is Windows 2008 Server R2
+
+
+
+ Return true if the platform is Windows 2012 Server
+
+
+
+ Return true if the platform is Windows 7
+
+
+
+ Return true if the platform is Windows 8
+
+
+
+ The PropertyNames struct lists common property names, which are
+ accessed by reflection in the NUnit core. This provides a modicum
+ of type safety as opposed to using the strings directly.
+
+
+ Exception Type expected from a test
+
+ Exception Type expected from a test (pre-2.5)
+
+ FullName of the Exception Type expected from a test
+
+ FullName of the Exception Type expected from a test (pre-2.5)
+
+ ExpectedException Message
+
+ ExpectedException MatchType
+
+ Expected return result from test
+
+ Indicates whether there is an expected return result
+
+ Description of the test
+
+ Alternate test name
+
+ Arguments for the test
+
+ Indicates test case is ignored
+
+ Indicates test case is explicit
+
+ The reason a test case is ignored
+
+ Properties of the test
+
+ Categories of the test
+
+ Name of a category
+
+ Reason for not running a test
+
+ Flag indicating excluded test should be marked as Ignored
+
+ Name of an addin that must be present to run a test
+
+
+ The ResultState enum indicates the result of running a test
+
+
+
+ The result is inconclusive
+
+
+
+ The test was not runnable.
+
+
+
+ The test has been skipped.
+
+
+
+ The test has been ignored.
+
+
+
+ The test succeeded
+
+
+
+ The test failed
+
+
+
+ The test encountered an unexpected exception
+
+
+
+ The test was cancelled by the user
+
+
+
+ The FailureSite enum indicates the stage of a test
+ in which an error or failure occured.
+
+
+
+ Failure in the test itself
+
+
+
+ Failure in the SetUp method
+
+
+
+ Failure in the TearDown method
+
+
+
+ Failure of a parent test
+
+
+
+ Failure of a child test
+
+
+
+ The RunState enum indicates whether a test
+ can be executed. When used on a TestResult
+ it may also indicate whether the test has
+ been executed. See individual values for
+ restrictions on use.
+
+
+
+ The test is not runnable.
+
+
+
+ The test is runnable. This value would
+ normally not appear on a TestResult, since
+ it would change to Executed.
+
+
+
+ The test can only be run explicitly. Would
+ normally not appear on a TestResult, since
+ it would change to Executed or Skipped.
+
+
+
+ The test has been skipped. This value may
+ appear on a Test when certain attributes
+ are used to skip the test.
+
+
+
+ The test has been ignored. May appear on
+ a Test, when the IgnoreAttribute is used.
+ Appears on a TestResult in that case or
+ if the test is dynamically ignored.
+
+
+
+ Enumeration identifying a common language
+ runtime implementation.
+
+
+ Any supported runtime framework
+
+ Microsoft .NET Framework
+
+ Microsoft .NET Compact Framework
+
+ Microsoft Shared Source CLI
+
+ Mono
+
+
+ RuntimeFramework represents a particular version
+ of a common language runtime implementation.
+
+
+
+ DefaultVersion is an empty Version, used to indicate that
+ NUnit should select the CLR version to use for the test.
+
+
+
+ Construct from a runtime type and version
+
+ The runtime type of the framework
+ The version of the framework
+
+
+ Static method to return a RuntimeFramework object
+ for the framework that is currently in use.
+
+
+
+ Gets an array of all available frameworks
+
+
+
+ Returns true if the current RuntimeFramework is available.
+ In the current implementation, only Mono and Microsoft .NET
+ are supported.
+
+ True if it's available, false if not
+
+
+ The type of this runtime framework
+
+
+
+ The framework version for this runtime framework
+
+
+
+ The CLR version for this runtime framework
+
+
+
+ Return true if any CLR version may be used in
+ matching this RuntimeFramework object.
+
+
+
+ Returns the Display name for this framework
+
+
+
+ Parses a string representing a RuntimeFramework.
+ The string may be just a RuntimeType name or just
+ a Version or a hyphentated RuntimeType-Version or
+ a Version prefixed by 'v'.
+
+
+
+
+
+ Returns the best available framework that matches a target framework.
+ If the target framework has a build number specified, then an exact
+ match is needed. Otherwise, the matching framework with the highest
+ build number is used.
+
+
+
+
+
+ Overridden to return the short name of the framework
+
+
+
+
+ Returns true if this framework's supports executing under the
+ requested target framework. The target is supported if
+ 1. The runtime types are the same or either one is RuntimeType.Any
+ 2. All specified (non-negative) components of the CLR version are equal.
+ 3. The major and minor components of the current framework version are
+ greater than or equal to the corresponding target components.
+ The last provision allows tests requiring .NET 2.0 to run under the
+ 3.0 and 3.5 platforms and those requiring .NET 4.0 to run under 4.5.
+
+ The RuntimeFramework to be matched.
+ True on match, otherwise false
+
+
+ Test Class.
+
+
+
+ TestName that identifies this test
+
+
+
+ Indicates whether the test should be executed
+
+
+
+ Test suite containing this test, or null
+
+
+
+ A dictionary of properties, used to add information
+ to tests without requiring the class to change.
+
+
+
+ Return true if the test requires a thread
+
+
+
+ Get the desired apartment state for running the test
+
+
+
+ Get the current apartment state of the test
+
+
+
+ Gets a boolean value indicating whether this
+ test should run on it's own thread.
+
+
+
+ Constructs a test given its name
+
+ The name of the test
+
+
+ Constructs a test given the path through the
+ test hierarchy to its parent and a name.
+
+ The parent tests full name
+ The name of the test
+
+
+ Constructs a test given a TestName object
+
+ The TestName for this test
+
+
+ Sets the runner id of a test and optionally its children
+
+ The runner id to be used
+ True if all children should get the same id
+
+
+ Gets the TestName of the test
+
+
+
+ Gets a string representing the kind of test
+ that this object represents, for use in display.
+
+
+
+ Whether or not the test should be run
+
+
+
+ Reason for not running the test, if applicable
+
+
+
+ Gets a count of test cases represented by
+ or contained under this test.
+
+
+
+ Gets a list of categories associated with this test.
+
+
+
+ Gets a description associated with this test.
+
+
+
+ Gets the property dictionary for this test
+
+
+
+ Indicates whether this test is a suite
+
+
+
+ Gets the parent test of this test
+
+
+
+ Gets the parent as a Test object.
+ Used by the core to set the parent.
+
+
+
+ Gets this test's child tests
+
+
+
+ Gets the Type of the fixture used in running this test
+
+
+
+ Gets the name of the class containing this test. Returns
+ null if the test is not associated with a class.
+
+
+
+ Gets the name of the method implementing this test.
+ Returns null if the test is not implemented as a method.
+
+
+
+ Gets or sets a fixture object for running this test
+
+
+
+ Gets a count of test cases that would be run using
+ the specified filter.
+
+
+
+
+
+ Runs the test under a particular filter, sending
+ notifications to a listener.
+
+ An event listener to receive notifications
+ A filter used in running the test
+
+
+
+ Compares this test to another test for sorting purposes
+
+ The other test
+ Value of -1, 0 or +1 depending on whether the current test is less than, equal to or greater than the other test
+
+
+ Abstract base for all types of TestAgents.
+ A TestAgent provides services of locating,
+ loading and running tests in a particular
+ context such as an AppDomain or Process.
+
+
+
+ Reference to the TestAgency that controls this agent
+
+
+
+ This agent's assigned id
+
+
+
+ Constructs a TestAgent
+
+
+
+
+ Consructor used by TestAgency when creating
+ an agent.
+
+
+
+
+
+ The TestAgency with which this agent is asssociated,
+ or null if the agent is not tied to an agency.
+
+
+
+ A Guid that uniquely identifies this agent.
+
+
+
+ Starts the agent, performing any required initialization
+
+
+
+
+ Stops the agent, releasing any resources
+
+
+
+ Creates a runner using a given runner id
+
+
+
+ Dispose is overridden to stop the agent
+
+
+
+ Overridden to cause object to live indefinitely
+
+
+
+ TestAssemblyInfo holds information about a loaded test assembly
+
+
+
+ Constructs a TestAssemblyInfo
+
+ The name of the assembly
+ The version of the runtime for which the assembly was built
+ The runtime framework under which the assembly is loaded
+ A list of test framework useds by the assembly
+
+
+ Gets the name of the assembly
+
+
+
+ Gets the runtime version for which the assembly was built
+
+
+
+ Gets the runtime framework under which the assembly is loaded
+
+
+
+ Gets the runtime version under which the assembly is loaded
+
+
+
+ The Id of the process in which the assembly is loaded
+
+
+
+ The friendly name of the AppDomain in which the assembly is loaded
+
+
+
+ The Application Base of the AppDomain in which the assembly is loaded
+
+
+
+ The PrivateBinPath of the AppDomain in which the assembly is loaded
+
+
+
+ The ConfigurationFile of the AppDomain in which the assembly is loaded
+
+
+
+ The name of the main module of the process in which the assembly is loaded
+
+
+
+ Gets a list of testframeworks referenced by the assembly
+
+
+
+ Interface to be implemented by filters applied to tests.
+ The filter applies when running the test, after it has been
+ loaded, since this is the only time an ITest exists.
+
+
+
+ Unique Empty filter.
+
+
+
+ Indicates whether this is the EmptyFilter
+
+
+
+ Determine if a particular test passes the filter criteria. The default
+ implementation checks the test itself, its parents and any descendants.
+ Derived classes may override this method or any of the Match methods
+ to change the behavior of the filter.
+
+ The test to which the filter is applied
+ True if the test passes the filter, otherwise false
+
+
+ Determine whether the test itself matches the filter criteria, without
+ examining either parents or descendants.
+
+ The test to which the filter is applied
+ True if the filter matches the any parent of the test
+
+
+ Determine whether any ancestor of the test mateches the filter criteria
+
+ The test to which the filter is applied
+ True if the filter matches the an ancestor of the test
+
+
+ Determine whether any descendant of the test matches the filter criteria.
+
+ The test to be matched
+ True if at least one descendant matches the filter criteria
+
+
+ Nested class provides an empty filter - one that always
+ returns true when called, unless the test is marked explicit.
+
+
+
+ TestID encapsulates a unique identifier for tests. As
+ currently implemented, this is an integer and is unique
+ within the AppDomain. TestID is one component of a
+ TestName. We use this object, rather than a raw int,
+ for two reasons: (1) to hide the implementation so
+ it may be changed later if necessary and (2) so that the
+ id may be null in a "weak" TestName.
+
+
+
+ The int key that distinguishes this test from all others created
+ by the same runner.
+
+
+
+ Static value to seed ids. It's started at 1000 so any
+ uninitialized ids will stand out.
+
+
+
+ Construct a new TestID
+
+
+
+ Construct a TestID with a given value.
+ Used in parsing test names and in order
+ to construct an artificial test node for
+ aggregating multiple test runners.
+
+
+
+
+ Parse a TestID from it's string representation
+
+
+
+
+
+ Override of Equals method to allow comparison of TestIDs
+
+
+
+
+
+ Override of GetHashCode for TestIDs
+
+
+
+
+ Override ToString() to display the int id
+
+
+
+
+ Operator == override
+
+
+
+
+
+
+ Operator != override
+
+
+
+
+
+
+ Clone this TestID
+
+ An identical TestID
+
+
+ TestInfo holds common info about a test. It represents only
+ a single test or a suite and contains no references to other
+ tests. Since it is informational only, it can easily be passed
+ around using .Net remoting.
+ TestInfo is used directly in all EventListener events and in
+ TestResults. It contains an ID, which can be used by a
+ runner to locate the actual test.
+ TestInfo also serves as the base class for TestNode, which
+ adds hierarchical information and is used in client code to
+ maintain a visible image of the structure of the tests.
+
+
+
+ TestName that identifies this test
+
+
+
+ Reason for not running the test
+
+
+
+ Number of test cases in this test or suite
+
+
+
+ True if this is a suite
+
+
+
+ The test description
+
+
+
+ A list of all the categories assigned to a test
+
+
+
+ A dictionary of properties, used to add information
+ to tests without requiring the class to change.
+
+
+
+ Construct from an ITest
+
+ Test from which a TestNode is to be constructed
+
+
+ Construct as a parent to multiple tests.
+
+ The name to use for the new test
+ An array of child tests
+
+
+ Construct given a test name
+
+ The TestName for the new test
+
+
+ Gets the completely specified name of the test
+ encapsulated in a TestName object.
+
+
+
+ The name of the class containing this test, or null
+
+
+
+ The name of the method implementing this test, or null
+
+
+
+ Gets a string representing the kind of test this
+ object represents for display purposes.
+
+
+
+ The test description
+
+
+
+ Gets the RunState for this test
+
+
+
+ The reason for ignoring a test
+
+
+
+ Count of test cases in this test.
+
+
+
+ Gets the parent test of this test
+
+
+
+ Gets a list of the categories applied to this test
+
+
+
+ Gets a list of any child tests
+
+
+
+ True if this is a suite, false if a test case
+
+
+
+ Gets the Properties dictionary for this test
+
+
+
+ Counts the test cases that would be run if this
+ test were executed using the provided filter.
+
+ The filter to apply
+ A count of test cases
+
+
+ TestName encapsulates all info needed to identify and
+ locate a test that has been loaded by a runner. It consists
+ of a three components: the simple name of the test, an int
+ id that is unique to a given tree of tests and an int
+ runner id that identifies the particular runner that
+ holds the test instance.
+
+
+
+ ID that uniquely identifies the test
+
+
+
+ The simple name of the test, without qualification
+
+
+
+ The fully qualified name of the test
+
+
+
+ Gets or sets the TestID that uniquely identifies this test
+
+
+
+ Gets the ID for the runner that created the test from
+ the TestID, or returns -1 if the TestID is null.
+
+
+
+ Gets or sets the simple name of the test
+
+
+
+ Gets or sets the full (qualified) name of the test
+
+
+
+ Get the string representation of this test name, incorporating all
+ the components of the name.
+
+
+
+ Parse a string representation of a TestName,
+ returning a TestName.
+
+ The string to parse
+ A TestName
+
+
+ Compares two TestNames for equality
+
+ the other TestID
+ True if the two TestIDs are equal
+
+
+ Calculates a hashcode for this TestID
+
+ The hash code.
+
+
+ Override ToString() to display the UniqueName
+
+
+
+
+ Override the == operator
+
+
+
+
+
+
+ Override the != operator
+
+
+
+
+
+
+ Returns a duplicate of this TestName
+
+
+
+
+ TestNode represents a single test or suite in the test hierarchy.
+ TestNode holds common info needed about a test and represents a
+ single node - either a test or a suite - in the hierarchy of tests.
+ TestNode extends TestInfo, which holds all the information with
+ the exception of the list of child classes. When constructed from
+ a Test, TestNodes are always fully populated with child TestNodes.
+ Like TestInfo, TestNode is purely a data class, and is not able
+ to execute tests.
+
+
+
+ For a test suite, the child tests or suites
+ Null if this is not a test suite
+
+
+
+ Construct from an ITest
+
+ Test from which a TestNode is to be constructed
+
+
+ Construct a TestNode given a TestName and an
+ array of child tests.
+
+ The TestName of the new test
+ An array of tests to be added as children of the new test
+
+
+ Gets the parent test of the current test
+
+
+
+ Array of child tests, null if this is a test case.
+
+
+
+ The TestOutput class holds a unit of output from
+ a test to either stdOut or stdErr
+
+
+
+ Construct with text and an ouput destination type
+
+ Text to be output
+ Destination of output
+
+
+ Return string representation of the object for debugging
+
+
+
+
+ Get the text
+
+
+
+ Get the output type
+
+
+
+ Enum representing the output destination
+ It uses combinable flags so that a given
+ output control can accept multiple types
+ of output. Normally, each individual
+ output uses a single flag value.
+
+
+
+ Send output to stdOut
+
+
+
+ Send output to stdErr
+
+
+
+ Send output to Trace
+
+
+
+ Send output to Log
+
+
+
+ Represents the manner in which test assemblies are
+ distributed across processes.
+
+
+
+ Use the default setting, depending on the runner
+ and the nature of the tests to be loaded.
+
+
+
+ Run tests directly in the NUnit process
+
+
+
+ Run tests in a single separate process
+
+
+
+ Run tests in a separate process per assembly
+
+
+
+ Represents the manner in which test assemblies use
+ AppDomains to provide isolation
+
+
+
+ Use the default setting, depending on the runner
+ and the nature of the tests to be loaded.
+
+
+
+ Don't create a test domain - run in the primary AppDomain
+
+
+
+ Run tests in a single separate test domain
+
+
+
+ Run tests in a separate domain per assembly
+
+
+
+ TestPackage holds information about a set of tests to
+ be loaded by a TestRunner. It may represent a single
+ assembly or a set of assemblies. It supports selection
+ of a single test fixture for loading.
+
+
+
+ Construct a package, specifying the name of the package.
+ If the package name is an assembly file type (dll or exe)
+ then the resulting package represents a single assembly.
+ Otherwise it is a container for multiple assemblies.
+
+ The name of the package
+
+
+ Construct a package, specifying the name to be used
+ and a list of assemblies.
+
+ The package name, used to name the top-level test node
+ The list of assemblies comprising the package
+
+
+ Gets the name of the package
+
+
+
+ Gets the full name of the package, which is usually
+ the path to the NUnit project used to create the it
+
+
+
+ The BasePath to be used in loading the assemblies
+
+
+
+ The configuration file to be used
+
+
+
+ Addditional directories to be probed when loading assemblies
+
+
+
+ Indicates whether the probing path should be generated
+ automatically based on the list of assemblies.
+
+
+
+ Assemblies to be loaded. At least one must be specified.
+
+
+
+ Return true if the package represents a single assembly.
+ No root node is displayed in that case.
+
+
+
+ Fully qualified name of test to be loaded. If not
+ specified, all the tests in the assemblies are loaded.
+
+
+
+ Gets the dictionary of settings for this TestPackage
+
+
+
+ Return the value of a setting or a default.
+
+ The name of the setting
+ The default value
+
+
+
+ Return the value of a string setting or a default.
+
+ The name of the setting
+ The default value
+
+
+
+ Return the value of a bool setting or a default.
+
+ The name of the setting
+ The default value
+
+
+
+ Return the value of an int setting or a default.
+
+ The name of the setting
+ The default value
+
+
+
+ Return the value of a enum setting or a default.
+
+ The name of the setting
+ The default value
+
+
+
+ The TestResult class represents
+ the result of a test and is used to
+ communicate results across AppDomains.
+
+
+
+ Indicates the result of the test
+
+
+
+ Indicates the location of a failure
+
+
+
+ The elapsed time for executing this test
+
+
+
+ The test that this result pertains to
+
+
+
+ The stacktrace at the point of failure
+
+
+
+ Message giving the reason for failure
+
+
+
+ List of child results
+
+
+
+ Number of asserts executed by this test
+
+
+
+ Construct a test result given a TestInfo
+
+ The test to be used
+
+
+ Construct a TestResult given an ITest
+
+
+
+
+ Construct a TestResult given a TestName
+
+ A TestName
+
+
+ Gets the ResultState of the test result, which
+ indicates the success or failure of the test.
+
+
+
+ Gets the stage of the test in which a failure
+ or error occured.
+
+
+
+ Indicates whether the test executed
+
+
+
+ Gets the name of the test result
+
+
+
+ Gets the full name of the test result
+
+
+
+ Gets the test associated with this result
+
+
+
+ Indicates whether the test ran successfully
+
+
+
+ Indicates whether the test failed
+
+
+
+ Indicates whether the test had an error (as opposed to a failure)
+
+
+
+ Gets a description associated with the test
+
+
+
+ Gets the elapsed time for running the test
+
+
+
+ Gets the message associated with a test
+ failure or with not running the test
+
+
+
+ Gets any stacktrace associated with an
+ error or failure.
+
+
+
+ Gets or sets the count of asserts executed
+ when running the test.
+
+
+
+ Return true if this result has any child results
+
+
+
+ Gets a list of the child results of this TestResult
+
+
+
+ Mark the test as succeeding
+
+
+
+ Mark the test as succeeding and set a message
+
+
+
+ Mark the test as ignored.
+
+ The reason the test was not run
+
+
+ Mark the test as ignored.
+
+ The ignore exception that was thrown
+
+
+ Mark the test as ignored.
+
+ The reason the test was not run
+ Stack trace giving the location of the command
+
+
+ Mark the test as skipped.
+
+ The reason the test was not run
+
+
+ Mark the test a not runnable with a reason
+
+ The reason the test is invalid
+
+
+ Mark the test as not runnable due to a builder exception
+
+ The exception thrown by the builder or an addin
+
+
+ Set the result of the test
+
+ The ResultState to use in the result
+ The reason the test was not run
+ Stack trace giving the location of the command
+ The location of the failure, if any
+
+
+ Set the result of the test
+
+ The ResultState to use in the result
+ The reason the test was not run
+ Stack trace giving the location of the command
+
+
+ Set the result of the test.
+
+ The ResultState to use in the result
+ The exception that caused this result
+ The site at which an error or failure occured
+
+
+ Mark the test as a failure due to an
+ assertion having failed.
+
+ Message to display
+ Stack trace giving the location of the failure
+
+
+ Mark the test as a failure due to an
+ assertion having failed.
+
+ Message to display
+ Stack trace giving the location of the failure
+ The site of the failure
+
+
+ Marks the result as an error due to an exception thrown
+ by the test.
+
+ The exception that was caught
+
+
+ Marks the result as an error due to an exception thrown
+ from the indicated FailureSite.
+
+ The exception that was caught
+ The site from which it was thrown
+
+
+ Add a child result
+
+ The child result to be added
+
+
+ The TestRunner Interface allows client code, such as the NUnit console and
+ gui runners, to load and run tests. This is the lowest level interface generally
+ supported for running tests and is implemented by the RemoteTestRunner class in
+ the NUnit core as well as by other classes running on the client side.
+ The Load method is used to load a suite of tests from one or more
+ assemblies, returning a tree of TestNodes to the caller.
+ The CountTestCases family of methods returns the number of test cases in the
+ loaded suite, either in its entirety or by using a filter to count a subset of tests.
+ The Run family of methods performs a test run synchronously, returning a TestResult
+ or TestResult[] to the caller. If provided, an EventListener interface will be
+ notified of significant events in the running of the tests. A filter may be used
+ to run a subset of the tests.
+ BeginRun and EndRun provide a simplified form of the asynchronous invocation
+ pattern used in many places within the .NET framework. Because the current
+ implementation allows only one run to be in process at a time, an IAsyncResult
+ is not used at this time.
+ Methods to cancel a run and to wait for a run to complete are also provided. The
+ result of the last run may be obtained by querying the TestResult property.
+
+
+
+ TestRunners are identified by an ID. So long as there
+ is only one test runner or a single chain of test runners,
+ the default id of 0 may be used. However, any client that
+ creates multiple runners must ensure that each one has a
+ unique ID in order to locate and run specific tests.
+
+
+
+ Running indicates whether a test is in progress. To retrieve the
+ results from an asynchronous test run, wait till Running is false.
+
+
+
+ Returns information about loaded assemblies
+
+
+
+ The loaded test, converted to a tree of TestNodes so they can be
+ serialized and marshalled to a remote client.
+
+
+
+ Result of the last test run.
+
+
+
+ Load the assemblies in a test package
+
+ The test package to be loaded
+ True if the tests were loaded successfully, otherwise false
+
+
+ Unload all tests previously loaded
+
+
+
+ Count Test Cases using a filter
+
+ The filter to apply
+ The number of test cases found
+
+
+ Run selected tests and return a test result. The test is run synchronously,
+ and the listener interface is notified as it progresses. Arguments control whether
+ trace and log output are passed back to the caller.
+
+ Interface to receive EventListener notifications.
+ The filter to apply when running the tests
+ If true, trace output is returned as a TestOutput event
+ The threshold for log output to be returned as a TestOutput event
+
+
+ Start a run of selected tests. The tests are run aynchronously and the
+ listener interface is notified as it progresses. Arguments control whether
+ trace and log output are passed back to the caller.
+
+ Interface to receive EventListener notifications.
+ The filter to apply when running the tests
+ If true, trace output is returned as a TestOutput event
+ The threshold for log output to be returned as a TestOutput event
+
+
+ Wait for an asynchronous run to complete and return the result.
+
+ A TestResult for the entire run
+
+
+ Cancel the test run that is in progress. For a synchronous run,
+ a client wanting to call this must create a separate run thread.
+
+
+
+ Wait for the test run in progress to complete. For a synchronous run,
+ a client wanting to call this must create a separate run thread. In
+ particular, a gui client calling this method is likely to hang, since
+ events will not be able to invoke methods on the gui thread.
+
+
+
+ Enumeration expressing the level of log messages to be
+ captured by NUnit and sent to the runner. These happen
+ to match the standard levels used by log4net, but will
+ be translated for any other loggers we support.
+
+
+ No logging
+
+ Severe error beyond which continuation is not possible
+
+ Error that may allow continuation
+
+ A warning message
+
+ An informational message
+
+ Messages used for debugging
+
+ All of the preceding plus more detailled messages if supported
+
+
diff --git a/frameworks/csharp/nunit/lib/nunit.util.dll b/frameworks/csharp/nunit/lib/nunit.util.dll
new file mode 100755
index 00000000..cd862ff0
Binary files /dev/null and b/frameworks/csharp/nunit/lib/nunit.util.dll differ
diff --git a/frameworks/csharp/nunit/log4net.dll b/frameworks/csharp/nunit/log4net.dll
new file mode 100644
index 00000000..20a2e1c4
Binary files /dev/null and b/frameworks/csharp/nunit/log4net.dll differ
diff --git a/frameworks/csharp/nunit/nunit-agent.exe b/frameworks/csharp/nunit/nunit-agent.exe
new file mode 100755
index 00000000..aaf9d9bc
Binary files /dev/null and b/frameworks/csharp/nunit/nunit-agent.exe differ
diff --git a/frameworks/csharp/nunit/nunit-agent.exe.config b/frameworks/csharp/nunit/nunit-agent.exe.config
new file mode 100644
index 00000000..43adb3b8
--- /dev/null
+++ b/frameworks/csharp/nunit/nunit-agent.exe.config
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frameworks/csharp/nunit/nunit-console.exe b/frameworks/csharp/nunit/nunit-console.exe
new file mode 100755
index 00000000..4b8accad
Binary files /dev/null and b/frameworks/csharp/nunit/nunit-console.exe differ
diff --git a/frameworks/csharp/nunit/nunit-console.exe.config b/frameworks/csharp/nunit/nunit-console.exe.config
new file mode 100644
index 00000000..c8b31ebe
--- /dev/null
+++ b/frameworks/csharp/nunit/nunit-console.exe.config
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frameworks/csharp/nunit/nunit-editor.exe b/frameworks/csharp/nunit/nunit-editor.exe
new file mode 100755
index 00000000..d00d9f78
Binary files /dev/null and b/frameworks/csharp/nunit/nunit-editor.exe differ
diff --git a/frameworks/csharp/nunit/nunit-editor.exe.mdb b/frameworks/csharp/nunit/nunit-editor.exe.mdb
new file mode 100644
index 00000000..cd781109
Binary files /dev/null and b/frameworks/csharp/nunit/nunit-editor.exe.mdb differ
diff --git a/frameworks/csharp/nunit/nunit.core.dll b/frameworks/csharp/nunit/nunit.core.dll
new file mode 100755
index 00000000..e0280a0a
Binary files /dev/null and b/frameworks/csharp/nunit/nunit.core.dll differ
diff --git a/frameworks/csharp/nunit/nunit.core.interfaces.dll b/frameworks/csharp/nunit/nunit.core.interfaces.dll
new file mode 100755
index 00000000..6fb27f79
Binary files /dev/null and b/frameworks/csharp/nunit/nunit.core.interfaces.dll differ
diff --git a/frameworks/csharp/nunit/nunit.core.interfaces.xml b/frameworks/csharp/nunit/nunit.core.interfaces.xml
new file mode 100644
index 00000000..0956b78b
--- /dev/null
+++ b/frameworks/csharp/nunit/nunit.core.interfaces.xml
@@ -0,0 +1,3150 @@
+
+
+
+ nunit.core.interfaces
+
+
+
+
+ The ITestCaseData interface is implemented by a class
+ that is able to return complete testcases for use by
+ a parameterized test method.
+ NOTE: This interface is used in both the framework
+ and the core, even though that results in two different
+ types. However, sharing the source code guarantees that
+ the various implementations will be compatible and that
+ the core is able to reflect successfully over the
+ framework implementations of ITestCaseData.
+
+
+
+
+ Gets the argument list to be provided to the test
+
+
+
+
+ Gets the expected result
+
+
+
+
+ Indicates whether a result has been specified.
+ This is necessary because the result may be
+ null, so it's value cannot be checked.
+
+
+
+
+ Gets the expected exception Type
+
+
+
+
+ Gets the FullName of the expected exception
+
+
+
+
+ Gets the name to be used for the test
+
+
+
+
+ Gets the description of the test
+
+
+
+
+ Gets a value indicating whether this is ignored.
+
+
+ true if ignored; otherwise, false.
+
+
+
+ Gets a value indicating whether this is explicit.
+
+
+ true if explicit; otherwise, false.
+
+
+
+ Gets the ignore reason.
+
+ The ignore reason.
+
+
+
+ The EventListener interface is used within the NUnit core to receive
+ notifications of significant events while a test is being run. These
+ events are propogated to any client, which may choose to convert them
+ to .NET events or to use them directly.
+
+
+
+
+ Called when a test run is starting
+
+ The name of the test being started
+ The number of test cases under this test
+
+
+
+ Called when a run finishes normally
+
+ The result of the test
+
+
+
+ Called when a run is terminated due to an exception
+
+ Exception that was thrown
+
+
+
+ Called when a test case is starting
+
+ The name of the test case
+
+
+
+ Called when a test case has finished
+
+ The result of the test
+
+
+
+ Called when a suite is starting
+
+ The name of the suite
+
+
+
+ Called when a suite has finished
+
+ The result of the suite
+
+
+
+ Called when an unhandled exception is detected during
+ the execution of a test run.
+
+ The exception thta was detected
+
+
+
+ Called when the test direts output to the console.
+
+ A console message
+
+
+
+ The Addin class holds information about an addin.
+
+
+
+
+ Construct an Addin for a type.
+
+ The type to be used
+
+
+
+ The name of the Addin
+
+
+
+
+ Brief description of what the Addin does
+
+
+
+
+ The type or types of extension provided, using
+ one or more members of the ExtensionType enumeration.
+
+
+
+
+ The AssemblyQualifiedName of the type that implements
+ the addin.
+
+
+
+
+ The status of the addin
+
+
+
+
+ Any message that clarifies the status of the Addin,
+ such as an error message or an explanation of why
+ the addin is disabled.
+
+
+
+
+ Return true if two Addins have teh same type name
+
+ The other addin to be compared
+
+
+
+ Return a hash code for this addin
+
+
+
+
+ The AddinStatus enum indicates the load status of an addin.
+
+
+
+
+ Not known - default
+
+
+
+
+ The addin is enabled but not loaded
+
+
+
+
+ The addin is disabled
+
+
+
+
+ The addin was loaded successfully
+
+
+
+
+ An error was encountered loading the addin
+
+
+
+
+ The ExtensionType enumeration is used to indicate the
+ kinds of extensions provided by an Addin. The addin
+ is only installed by hosts supporting one of its
+ extension types.
+
+
+
+
+ A Core extension is installed by the CoreExtensions
+ host in each test domain.
+
+
+
+
+ A Client extension is installed by all clients
+
+
+
+
+ A Gui extension is installed by the gui client
+
+
+
+
+ Add-ins are used to extend NUnti. All add-ins must
+ implement the IAddin interface.
+
+
+
+
+ When called, the add-in installs itself into
+ the host, if possible. Because NUnit uses separate
+ hosts for the client and test domain environments,
+ an add-in may be invited to istall itself more than
+ once. The add-in is responsible for checking which
+ extension points are supported by the host that is
+ passed to it and taking the appropriate action.
+
+ The host in which to install the add-in
+ True if the add-in was installed, otehrwise false
+
+
+
+ The IAddinRegistry interface allows registering addins
+ and retrieving information about them. It is also used
+ to record the load status of an addin.
+
+
+
+
+ Gets a list of all addins as Addin objects
+
+
+
+
+ Registers an addin
+
+ The addin to be registered
+
+
+
+ Returns true if an addin of a given name is registered
+
+ The name of the addin
+ True if an addin of that name is registered, otherwise false
+
+
+
+ Sets the load status of an addin
+
+ The name of the addin
+ The status to be set
+ An optional message explaining the status
+
+
+
+ The IDataPointProvider interface is used by extensions
+ that provide data for a single test parameter.
+
+
+
+
+ Determine whether any data is available for a parameter.
+
+ A ParameterInfo representing one
+ argument to a parameterized test
+ True if any data is available, otherwise false.
+
+
+
+ Return an IEnumerable providing data for use with the
+ supplied parameter.
+
+ A ParameterInfo representing one
+ argument to a parameterized test
+ An IEnumerable providing the required data
+
+
+
+ The IDataPointProvider2 interface extends IDataPointProvider
+ by making the test fixture for which the test is being built
+ available for use.
+
+
+
+
+ Determine whether any data is available for a parameter.
+
+ A ParameterInfo representing one
+ argument to a parameterized test
+ The test suite for which the test is being built
+ True if any data is available, otherwise false.
+
+
+
+ Return an IEnumerable providing data for use with the
+ supplied parameter.
+
+ A ParameterInfo representing one
+ argument to a parameterized test
+ The test suite for which the test is being built
+ An IEnumerable providing the required data
+
+
+
+ The IExtensionHost interface is implemented by each
+ of NUnit's Extension hosts. Currently, there is
+ only one host, which resides in the test domain.
+
+
+
+
+ Get a list of the ExtensionPoints provided by this host.
+
+
+
+
+ Get an interface to the framework registry
+
+
+
+
+ Return an extension point by name, if present
+
+ The name of the extension point
+ The extension point, if found, otherwise null
+
+
+
+ Gets the ExtensionTypes supported by this host
+
+ An enum indicating the ExtensionTypes supported
+
+
+
+ Represents a single point of extension for NUnit. Some extension
+ points may accept only a single extension, while others may
+ accept more than one at the same time.
+
+
+
+
+ Get the name of this extension point
+
+
+
+
+ Get the host that provides this extension point
+
+
+
+
+ Install an extension at this extension point. If the
+ extension object does not meet the requirements for
+ this extension point, an exception is thrown.
+
+ The extension to install
+
+
+
+ Removes an extension from this extension point. If the
+ extension object is not present, the method returns
+ without error.
+
+
+
+
+
+
+ Represents a single point of extension for NUnit. Some extension
+ points may accept only a single extension, while others may
+ accept more than one at the same time. This interface enhances
+ IExtensionPoint by allowing specification of a priority
+ order for applying addins.
+
+
+
+
+ Install an extension at this extension point specifying
+ an integer priority value for the extension.If the
+ extension object does not meet the requirements for
+ this extension point, or if the extension point does
+ not support the requested priority level, an exception
+ is thrown.
+
+ The extension to install
+ The priority level for this extension
+
+
+
+ The IFrameworkRegistry allows extensions to register new
+ frameworks or emulations of other frameworks.
+
+
+
+
+ Register a framework
+
+ The name of the framework
+ The name of the assembly that the tests reference
+
+
+
+ The ISuiteBuilder interface is exposed by a class that knows how to
+ build a suite from one or more Types.
+
+
+
+
+ Examine the type and determine if it is suitable for
+ this builder to use in building a TestSuite.
+ Note that returning false will cause the type to be ignored
+ in loading the tests. If it is desired to load the suite
+ but label it as non-runnable, ignored, etc., then this
+ method must return true.
+
+ The type of the fixture to be used
+ True if the type can be used to build a TestSuite
+
+
+
+ Build a TestSuite from type provided.
+
+ The type of the fixture to be used
+ A TestSuite
+
+
+
+ The ITestCaseBuilder interface is exposed by a class that knows how to
+ build a test case from certain methods.
+
+
+
+
+ Examine the method and determine if it is suitable for
+ this builder to use in building a TestCase.
+ Note that returning false will cause the method to be ignored
+ in loading the tests. If it is desired to load the method
+ but label it as non-runnable, ignored, etc., then this
+ method must return true.
+
+ The test method to examine
+ True is the builder can use this method
+
+
+
+ Build a TestCase from the provided MethodInfo.
+
+ The method to be used as a test case
+ A TestCase or null
+
+
+
+ ITestCaseBuilder2 extends ITestCaseBuilder with methods
+ that include the suite for which the test case is being
+ built. Test case builders not needing the suite can
+ continue to implement ITestCaseBuilder.
+
+
+
+
+ Examine the method and determine if it is suitable for
+ this builder to use in building a TestCase to be
+ included in the suite being populated.
+ Note that returning false will cause the method to be ignored
+ in loading the tests. If it is desired to load the method
+ but label it as non-runnable, ignored, etc., then this
+ method must return true.
+
+ The test method to examine
+ The suite being populated
+ True is the builder can use this method
+
+
+
+ Build a TestCase from the provided MethodInfo for
+ inclusion in the suite being constructed.
+
+ The method to be used as a test case
+ The test suite being populated, or null
+ A TestCase or null
+
+
+
+ The ITestCaseProvider interface is used by extensions
+ that provide data for parameterized tests, along with
+ certain flags and other indicators used in the test.
+
+
+
+
+ Determine whether any test cases are available for a parameterized method.
+
+ A MethodInfo representing a parameterized test
+ True if any cases are available, otherwise false.
+
+
+
+ Return an IEnumerable providing test cases for use in
+ running a paramterized test.
+
+
+
+
+
+
+
+
+ ITestCaseProvider2 extends ITestCaseProvider with methods
+ that include the suite for which the test case is being
+ built. TestCaseProviders not needing the suite can
+ continue to implement ITestCaseBuilder.
+
+
+
+
+ Determine whether any test cases are available for a parameterized method.
+
+ A MethodInfo representing a parameterized test
+ The suite for which the test case is being built
+ True if any cases are available, otherwise false.
+
+
+
+ Return an IEnumerable providing test cases for use in
+ running a paramterized test.
+
+
+
+ The suite for which the test case is being built
+
+
+
+
+
+ DecoratorPriority wraps constants that may be used
+ to represent the relative priority of TestDecorators.
+ Decorators with a lower priority are applied first
+ so that higher priority decorators wrap them.
+ NOTE: This feature is subject to change.
+
+
+
+
+ The default priority, equivalent to Normal
+
+
+
+
+ Priority for Decorators that must apply first
+
+
+
+
+ Normal Decorator priority
+
+
+
+
+ Priority for Decorators that must apply last
+
+
+
+
+ The ITestDecorator interface is exposed by a class that knows how to
+ enhance the functionality of a test case or suite by decorating it.
+
+
+
+
+ Examine the a Test and either return it as is, modify it
+ or return a different TestCase.
+
+ The Test to be decorated
+ The MethodInfo used to construct the test
+ The resulting Test
+
+
+
+ NUnitAddinAttribute is used to mark all add-ins. The marked class
+ must implement the IAddin interface.
+
+
+
+
+ The name of this addin
+
+
+
+
+ A description for the addin
+
+
+
+
+ The type of extension provided
+
+
+
+
+ Default Constructor
+
+
+
+
+ ParameterSet encapsulates method arguments and
+ other selected parameters needed for constructing
+ a parameterized test case.
+
+
+
+
+ A dictionary of properties, used to add information
+ to tests without requiring the class to change.
+
+
+
+
+ The RunState for this set of parameters.
+
+
+
+
+ Holds any exception thrown by the parameter provider
+
+
+
+
+ The arguments to be used in running the test,
+ which must match the method signature.
+
+
+
+
+ The original arguments supplied by the user,
+ used for display purposes.
+
+
+
+
+ The Type of any exception that is expected.
+
+
+
+
+ The FullName of any exception that is expected
+
+
+
+
+ The Message of any exception that is expected
+
+
+
+
+ Gets or sets the type of match to be performed on the expected message
+
+
+
+
+ The expected result of the test, which
+ must match the method return type.
+
+
+
+
+ Returns true if an expected result has been
+ specified for this parameter set.
+
+
+
+
+ A description to be applied to this test case
+
+
+
+
+ A name to be used for this test case in lieu
+ of the standard generated name containing
+ the argument list.
+
+
+
+
+ Gets or sets a value indicating whether this is ignored.
+
+
+ true if ignored; otherwise, false.
+
+
+
+ Gets or sets a value indicating whether this is explicit.
+
+
+ true if explicit; otherwise, false.
+
+
+
+ Gets or sets the ignore reason.
+
+ The ignore reason.
+
+
+
+ Gets a list of categories associated with this test.
+
+
+
+
+ Gets the property dictionary for this test
+
+
+
+
+ Construct a non-runnable ParameterSet, specifying
+ the provider excetpion that made it invalid.
+
+
+
+
+ Construct an empty parameter set, which
+ defaults to being Runnable.
+
+
+
+
+ Constructs a ParameterSet from another object, accessing properties
+ by reflection. The object must expose at least an Arguments property
+ in order for the test to be runnable.
+
+
+
+
+
+
+ Summary description for TestFramework.
+
+
+
+
+ The name of the framework
+
+
+
+
+ The file name of the assembly that defines the framwork
+
+
+
+
+ Constructs a TestFramwork object given its name and assembly name.
+
+
+
+
+
+
+
+
+ Combines multiple filters so that a test must pass all
+ of them in order to pass this filter.
+
+
+
+
+ Constructs an empty AndFilter
+
+
+
+
+ Constructs an AndFilter from an array of filters
+
+
+
+
+
+
+ Adds a filter to the list of filters
+
+ The filter to be added
+
+
+
+ Return an array of the composing filters
+
+
+
+
+ Checks whether the AndFilter is matched by a test
+
+ The test to be matched
+ True if all the component filters pass, otherwise false
+
+
+
+ Checks whether the AndFilter is matched by a test
+
+ The test to be matched
+ True if all the component filters match, otherwise false
+
+
+
+ Return string representation of the filter.
+
+
+
+
+ CategoryFilter is able to select or exclude tests
+ based on their categories.
+
+
+
+
+ Construct an empty CategoryFilter
+
+
+
+
+ Construct a CategoryFilter using a single category name
+
+ A category name
+
+
+
+ Construct a CategoryFilter using an array of category names
+
+ An array of category names
+
+
+
+ Add a category name to the filter
+
+ A category name
+
+
+
+ Check whether the filter matches a test
+
+ The test to be matched
+
+
+
+
+
+ Return the string representation of a category filter
+
+
+
+
+
+
+ Gets the list of categories from this filter
+
+
+
+
+ Summary description for NameFilter.
+
+
+
+
+ Construct an empty NameFilter
+
+
+
+
+ Construct a NameFilter for a single TestName
+
+
+
+
+
+
+ Add a TestName to a NameFilter
+
+
+
+
+
+
+ Check if a test matches the filter
+
+ The test to match
+ True if it matches, false if not
+
+
+
+ NotFilter negates the operation of another filter
+
+
+
+
+ Construct a not filter on another filter. The topLevel
+ argument is used to trigger special handling when tests
+ are being excluded.
+
+ The filter to be negated
+
+
+
+ Construct a not filter on another filter. The topLevel
+ argument is used to trigger special handling when tests
+ are being excluded.
+
+ The filter to be negated
+ Indicates whether this is a top level NotFilter
+
+
+
+ Indicates whether this is a top-level NotFilter,
+ requiring special handling of Explicit
+
+
+
+
+ Gets the base filter
+
+
+
+
+ Check whether the filter matches a test
+
+ The test to be matched
+ True if it matches, otherwise false
+
+
+
+ Determine whether any descendant of the test matches the filter criteria.
+
+ The test to be matched
+ True if at least one descendant matches the filter criteria
+
+
+
+ Return string representation of the filter
+
+
+
+
+ Combines multiple filters so that a test must pass one
+ of them in order to pass this filter.
+
+
+
+
+ Constructs an empty OrFilter
+
+
+
+
+ Constructs an AndFilter from an array of filters
+
+
+
+
+
+
+ Adds a filter to the list of filters
+
+ The filter to be added
+
+
+
+ Return an array of the composing filters
+
+
+
+
+ Checks whether the OrFilter is matched by a test
+
+ The test to be matched
+ True if any of the component filters pass, otherwise false
+
+
+
+ Checks whether the OrFilter is matched by a test
+
+ The test to be matched
+ True if any of the component filters match, otherwise false
+
+
+
+ Return the string representation of an or filter
+
+
+
+
+
+
+ SimpleName filter selects tests based on their name
+
+
+
+
+ Construct an empty SimpleNameFilter
+
+
+
+
+ Construct a SimpleNameFilter for a single name
+
+ The name the filter will recognize.
+
+
+
+ Construct a SimpleNameFilter for an array of names
+
+ The names the filter will recognize.
+
+
+
+ Add a name to a SimpleNameFilter
+
+ The name to be added.
+
+
+
+ Add an array of names to a SimpleNameFilter
+
+ The name to be added.
+
+
+
+ Check whether the filter matches a test
+
+ The test to be matched
+ True if it matches, otherwise false
+
+
+
+ The IAgency interface is implemented by a TestAgency in
+ order to allow TestAgents to register with it.
+
+
+
+
+ Registers an agent with an agency
+
+
+
+
+
+
+ The IService interface is implemented by all Services.
+
+
+
+
+ Initialize the Service
+
+
+
+
+ Do any cleanup needed before terminating the service
+
+
+
+
+ Common interface supported by all representations
+ of a test. Only includes informational fields.
+ The Run method is specifically excluded to allow
+ for data-only representations of a test.
+
+
+
+
+ Gets the completely specified name of the test
+ encapsulated in a TestName object.
+
+
+
+
+ Gets the name of the class containing this test. Returns
+ null if the test is not associated with a class.
+
+
+
+
+ Gets the name of the method implementing this test.
+ Returns null if the test is not implemented as a method.
+
+
+
+
+ Gets a string representing the type of test, e.g.: "Test Case"
+
+
+
+
+ Indicates whether the test can be run using
+ the RunState enum.
+
+
+
+
+ Reason for not running the test, if applicable
+
+
+
+
+ Count of the test cases ( 1 if this is a test case )
+
+
+
+
+ Categories available for this test
+
+
+
+
+ Return the description field.
+
+
+
+
+ Return additional properties of the test
+
+
+
+
+ True if this is a suite
+
+
+
+
+ Gets the parent test of this test
+
+
+
+
+ For a test suite, the child tests or suites
+ Null if this is not a test suite
+
+
+
+
+ Count the test cases that pass a filter. The
+ result should match those that would execute
+ when passing the same filter to Run.
+
+ The filter to apply
+ The count of test cases
+
+
+
+ Interface to be implemented by filters applied to tests.
+ The filter applies when running the test, after it has been
+ loaded, since this is the only time an ITest exists.
+
+
+
+
+ Indicates whether this is the EmptyFilter
+
+
+
+
+ Determine if a particular test passes the filter criteria. Pass
+ may examine the parents and/or descendants of a test, depending
+ on the semantics of the particular filter
+
+ The test to which the filter is applied
+ True if the test passes the filter, otherwise false
+
+
+
+ Determine whether the test itself matches the filter criteria,
+ without examining either parents or descendants.
+
+ The test to which the filter is applied
+ True if the filter matches the any parent of the test
+
+
+
+ OSPlatform represents a particular operating system platform
+
+
+
+
+ Platform ID for Unix as defined by Microsoft .NET 2.0 and greater
+
+
+
+
+ Platform ID for Unix as defined by Mono
+
+
+
+
+ Get the OSPlatform under which we are currently running
+
+
+
+
+ Product Type Enumeration used for Windows
+
+
+
+
+ Product type is unknown or unspecified
+
+
+
+
+ Product type is Workstation
+
+
+
+
+ Product type is Domain Controller
+
+
+
+
+ Product type is Server
+
+
+
+
+ Construct from a platform ID and version
+
+
+
+
+ Construct from a platform ID, version and product type
+
+
+
+
+ Get the platform ID of this instance
+
+
+
+
+ Get the Version of this instance
+
+
+
+
+ Get the Product Type of this instance
+
+
+
+
+ Return true if this is a windows platform
+
+
+
+
+ Return true if this is a Unix or Linux platform
+
+
+
+
+ Return true if the platform is Win32S
+
+
+
+
+ Return true if the platform is Win32Windows
+
+
+
+
+ Return true if the platform is Win32NT
+
+
+
+
+ Return true if the platform is Windows CE
+
+
+
+
+ Return true if the platform is Xbox
+
+
+
+
+ Return true if the platform is MacOSX
+
+
+
+
+ Return true if the platform is Windows 95
+
+
+
+
+ Return true if the platform is Windows 98
+
+
+
+
+ Return true if the platform is Windows ME
+
+
+
+
+ Return true if the platform is NT 3
+
+
+
+
+ Return true if the platform is NT 4
+
+
+
+
+ Return true if the platform is NT 5
+
+
+
+
+ Return true if the platform is Windows 2000
+
+
+
+
+ Return true if the platform is Windows XP
+
+
+
+
+ Return true if the platform is Windows 2003 Server
+
+
+
+
+ Return true if the platform is NT 6
+
+
+
+
+ Return true if the platform is Vista
+
+
+
+
+ Return true if the platform is Windows 2008 Server (original or R2)
+
+
+
+
+ Return true if the platform is Windows 2008 Server (original)
+
+
+
+
+ Return true if the platform is Windows 2008 Server R2
+
+
+
+
+ Return true if the platform is Windows 2012 Server
+
+
+
+
+ Return true if the platform is Windows 7
+
+
+
+
+ Return true if the platform is Windows 8
+
+
+
+
+ The PropertyNames struct lists common property names, which are
+ accessed by reflection in the NUnit core. This provides a modicum
+ of type safety as opposed to using the strings directly.
+
+
+
+ Exception Type expected from a test
+
+
+ Exception Type expected from a test (pre-2.5)
+
+
+ FullName of the Exception Type expected from a test
+
+
+ FullName of the Exception Type expected from a test (pre-2.5)
+
+
+ ExpectedException Message
+
+
+ ExpectedException MatchType
+
+
+ Expected return result from test
+
+
+ Indicates whether there is an expected return result
+
+
+ Description of the test
+
+
+ Alternate test name
+
+
+ Arguments for the test
+
+
+ Indicates test case is ignored
+
+
+ Indicates test case is explicit
+
+
+ The reason a test case is ignored
+
+
+ Properties of the test
+
+
+ Categories of the test
+
+
+ Name of a category
+
+
+ Reason for not running a test
+
+
+ Flag indicating excluded test should be marked as Ignored
+
+
+ Name of an addin that must be present to run a test
+
+
+
+ The ResultState enum indicates the result of running a test
+
+
+
+
+ The result is inconclusive
+
+
+
+
+ The test was not runnable.
+
+
+
+
+ The test has been skipped.
+
+
+
+
+ The test has been ignored.
+
+
+
+
+ The test succeeded
+
+
+
+
+ The test failed
+
+
+
+
+ The test encountered an unexpected exception
+
+
+
+
+ The test was cancelled by the user
+
+
+
+
+ The FailureSite enum indicates the stage of a test
+ in which an error or failure occured.
+
+
+
+
+ Failure in the test itself
+
+
+
+
+ Failure in the SetUp method
+
+
+
+
+ Failure in the TearDown method
+
+
+
+
+ Failure of a parent test
+
+
+
+
+ Failure of a child test
+
+
+
+
+ The RunState enum indicates whether a test
+ can be executed. When used on a TestResult
+ it may also indicate whether the test has
+ been executed. See individual values for
+ restrictions on use.
+
+
+
+
+ The test is not runnable.
+
+
+
+
+ The test is runnable. This value would
+ normally not appear on a TestResult, since
+ it would change to Executed.
+
+
+
+
+ The test can only be run explicitly. Would
+ normally not appear on a TestResult, since
+ it would change to Executed or Skipped.
+
+
+
+
+ The test has been skipped. This value may
+ appear on a Test when certain attributes
+ are used to skip the test.
+
+
+
+
+ The test has been ignored. May appear on
+ a Test, when the IgnoreAttribute is used.
+ Appears on a TestResult in that case or
+ if the test is dynamically ignored.
+
+
+
+
+ Enumeration identifying a common language
+ runtime implementation.
+
+
+
+ Any supported runtime framework
+
+
+ Microsoft .NET Framework
+
+
+ Microsoft .NET Compact Framework
+
+
+ Microsoft Shared Source CLI
+
+
+ Mono
+
+
+
+ RuntimeFramework represents a particular version
+ of a common language runtime implementation.
+
+
+
+
+ DefaultVersion is an empty Version, used to indicate that
+ NUnit should select the CLR version to use for the test.
+
+
+
+
+ Construct from a runtime type and version
+
+ The runtime type of the framework
+ The version of the framework
+
+
+
+ Static method to return a RuntimeFramework object
+ for the framework that is currently in use.
+
+
+
+
+ Gets an array of all available frameworks
+
+
+
+
+ Returns true if the current RuntimeFramework is available.
+ In the current implementation, only Mono and Microsoft .NET
+ are supported.
+
+ True if it's available, false if not
+
+
+
+ The type of this runtime framework
+
+
+
+
+ The framework version for this runtime framework
+
+
+
+
+ The CLR version for this runtime framework
+
+
+
+
+ Return true if any CLR version may be used in
+ matching this RuntimeFramework object.
+
+
+
+
+ Returns the Display name for this framework
+
+
+
+
+ Parses a string representing a RuntimeFramework.
+ The string may be just a RuntimeType name or just
+ a Version or a hyphentated RuntimeType-Version or
+ a Version prefixed by 'v'.
+
+
+
+
+
+
+
+
+ Returns the best available framework that matches a target framework.
+ If the target framework has a build number specified, then an exact
+ match is needed. Otherwise, the matching framework with the highest
+ build number is used.
+
+
+
+
+
+
+
+
+ Overridden to return the short name of the framework
+
+
+
+
+
+
+ Returns true if this framework's supports executing under the
+ requested target framework. The target is supported if
+ 1. The runtime types are the same or either one is RuntimeType.Any
+ 2. All specified (non-negative) components of the CLR version are equal.
+ 3. The major and minor components of the current framework version are
+ greater than or equal to the corresponding target components.
+ The last provision allows tests requiring .NET 2.0 to run under the
+ 3.0 and 3.5 platforms and those requiring .NET 4.0 to run under 4.5.
+
+ The RuntimeFramework to be matched.
+ True on match, otherwise false
+
+
+
+ Test Class.
+
+
+
+
+ TestName that identifies this test
+
+
+
+
+ Indicates whether the test should be executed
+
+
+
+
+ Test suite containing this test, or null
+
+
+
+
+ A dictionary of properties, used to add information
+ to tests without requiring the class to change.
+
+
+
+
+ Return true if the test requires a thread
+
+
+
+
+ Get the desired apartment state for running the test
+
+
+
+
+ Get the current apartment state of the test
+
+
+
+
+ Gets a boolean value indicating whether this
+ test should run on it's own thread.
+
+
+
+
+ Constructs a test given its name
+
+ The name of the test
+
+
+
+ Constructs a test given the path through the
+ test hierarchy to its parent and a name.
+
+ The parent tests full name
+ The name of the test
+
+
+
+ Constructs a test given a TestName object
+
+ The TestName for this test
+
+
+
+ Sets the runner id of a test and optionally its children
+
+ The runner id to be used
+ True if all children should get the same id
+
+
+
+ Gets the TestName of the test
+
+
+
+
+ Gets a string representing the kind of test
+ that this object represents, for use in display.
+
+
+
+
+ Whether or not the test should be run
+
+
+
+
+ Reason for not running the test, if applicable
+
+
+
+
+ Gets a count of test cases represented by
+ or contained under this test.
+
+
+
+
+ Gets a list of categories associated with this test.
+
+
+
+
+ Gets a description associated with this test.
+
+
+
+
+ Gets the property dictionary for this test
+
+
+
+
+ Indicates whether this test is a suite
+
+
+
+
+ Gets the parent test of this test
+
+
+
+
+ Gets the parent as a Test object.
+ Used by the core to set the parent.
+
+
+
+
+ Gets this test's child tests
+
+
+
+
+ Gets the Type of the fixture used in running this test
+
+
+
+
+ Gets the name of the class containing this test. Returns
+ null if the test is not associated with a class.
+
+
+
+
+ Gets the name of the method implementing this test.
+ Returns null if the test is not implemented as a method.
+
+
+
+
+ Gets or sets a fixture object for running this test
+
+
+
+
+ Gets a count of test cases that would be run using
+ the specified filter.
+
+
+
+
+
+
+
+
+ Runs the test under a particular filter, sending
+ notifications to a listener.
+
+ An event listener to receive notifications
+ A filter used in running the test
+
+
+
+
+
+ Compares this test to another test for sorting purposes
+
+ The other test
+ Value of -1, 0 or +1 depending on whether the current test is less than, equal to or greater than the other test
+
+
+
+ Abstract base for all types of TestAgents.
+ A TestAgent provides services of locating,
+ loading and running tests in a particular
+ context such as an AppDomain or Process.
+
+
+
+
+ Reference to the TestAgency that controls this agent
+
+
+
+
+ This agent's assigned id
+
+
+
+
+ Constructs a TestAgent
+
+
+
+
+
+
+ Consructor used by TestAgency when creating
+ an agent.
+
+
+
+
+
+
+
+
+ The TestAgency with which this agent is asssociated,
+ or null if the agent is not tied to an agency.
+
+
+
+
+ A Guid that uniquely identifies this agent.
+
+
+
+
+ Starts the agent, performing any required initialization
+
+
+
+
+
+
+ Stops the agent, releasing any resources
+
+
+
+
+ Creates a runner using a given runner id
+
+
+
+
+ Dispose is overridden to stop the agent
+
+
+
+
+ Overridden to cause object to live indefinitely
+
+
+
+
+ TestAssemblyInfo holds information about a loaded test assembly
+
+
+
+
+ Constructs a TestAssemblyInfo
+
+ The name of the assembly
+ The version of the runtime for which the assembly was built
+ The runtime framework under which the assembly is loaded
+ A list of test framework useds by the assembly
+
+
+
+ Gets the name of the assembly
+
+
+
+
+ Gets the runtime version for which the assembly was built
+
+
+
+
+ Gets the runtime framework under which the assembly is loaded
+
+
+
+
+ Gets the runtime version under which the assembly is loaded
+
+
+
+
+ The Id of the process in which the assembly is loaded
+
+
+
+
+ The friendly name of the AppDomain in which the assembly is loaded
+
+
+
+
+ The Application Base of the AppDomain in which the assembly is loaded
+
+
+
+
+ The PrivateBinPath of the AppDomain in which the assembly is loaded
+
+
+
+
+ The ConfigurationFile of the AppDomain in which the assembly is loaded
+
+
+
+
+ The name of the main module of the process in which the assembly is loaded
+
+
+
+
+ Gets a list of testframeworks referenced by the assembly
+
+
+
+
+ Interface to be implemented by filters applied to tests.
+ The filter applies when running the test, after it has been
+ loaded, since this is the only time an ITest exists.
+
+
+
+
+ Unique Empty filter.
+
+
+
+
+ Indicates whether this is the EmptyFilter
+
+
+
+
+ Determine if a particular test passes the filter criteria. The default
+ implementation checks the test itself, its parents and any descendants.
+ Derived classes may override this method or any of the Match methods
+ to change the behavior of the filter.
+
+ The test to which the filter is applied
+ True if the test passes the filter, otherwise false
+
+
+
+ Determine whether the test itself matches the filter criteria, without
+ examining either parents or descendants.
+
+ The test to which the filter is applied
+ True if the filter matches the any parent of the test
+
+
+
+ Determine whether any ancestor of the test mateches the filter criteria
+
+ The test to which the filter is applied
+ True if the filter matches the an ancestor of the test
+
+
+
+ Determine whether any descendant of the test matches the filter criteria.
+
+ The test to be matched
+ True if at least one descendant matches the filter criteria
+
+
+
+ Nested class provides an empty filter - one that always
+ returns true when called, unless the test is marked explicit.
+
+
+
+
+ TestID encapsulates a unique identifier for tests. As
+ currently implemented, this is an integer and is unique
+ within the AppDomain. TestID is one component of a
+ TestName. We use this object, rather than a raw int,
+ for two reasons: (1) to hide the implementation so
+ it may be changed later if necessary and (2) so that the
+ id may be null in a "weak" TestName.
+
+
+
+
+ The int key that distinguishes this test from all others created
+ by the same runner.
+
+
+
+
+ Static value to seed ids. It's started at 1000 so any
+ uninitialized ids will stand out.
+
+
+
+
+ Construct a new TestID
+
+
+
+
+ Construct a TestID with a given value.
+ Used in parsing test names and in order
+ to construct an artificial test node for
+ aggregating multiple test runners.
+
+
+
+
+
+
+ Parse a TestID from it's string representation
+
+
+
+
+
+
+
+
+ Override of Equals method to allow comparison of TestIDs
+
+
+
+
+
+
+
+
+ Override of GetHashCode for TestIDs
+
+
+
+
+
+
+ Override ToString() to display the int id
+
+
+
+
+
+
+ Operator == override
+
+
+
+
+
+
+
+
+
+
+ Operator != override
+
+
+
+
+
+
+
+
+
+
+ Clone this TestID
+
+ An identical TestID
+
+
+
+ TestInfo holds common info about a test. It represents only
+ a single test or a suite and contains no references to other
+ tests. Since it is informational only, it can easily be passed
+ around using .Net remoting.
+ TestInfo is used directly in all EventListener events and in
+ TestResults. It contains an ID, which can be used by a
+ runner to locate the actual test.
+ TestInfo also serves as the base class for TestNode, which
+ adds hierarchical information and is used in client code to
+ maintain a visible image of the structure of the tests.
+
+
+
+
+ TestName that identifies this test
+
+
+
+
+ Reason for not running the test
+
+
+
+
+ Number of test cases in this test or suite
+
+
+
+
+ True if this is a suite
+
+
+
+
+ The test description
+
+
+
+
+ A list of all the categories assigned to a test
+
+
+
+
+ A dictionary of properties, used to add information
+ to tests without requiring the class to change.
+
+
+
+
+ Construct from an ITest
+
+ Test from which a TestNode is to be constructed
+
+
+
+ Construct as a parent to multiple tests.
+
+ The name to use for the new test
+ An array of child tests
+
+
+
+ Construct given a test name
+
+ The TestName for the new test
+
+
+
+ Gets the completely specified name of the test
+ encapsulated in a TestName object.
+
+
+
+
+ The name of the class containing this test, or null
+
+
+
+
+ The name of the method implementing this test, or null
+
+
+
+
+ Gets a string representing the kind of test this
+ object represents for display purposes.
+
+
+
+
+ The test description
+
+
+
+
+ Gets the RunState for this test
+
+
+
+
+ The reason for ignoring a test
+
+
+
+
+ Count of test cases in this test.
+
+
+
+
+ Gets the parent test of this test
+
+
+
+
+ Gets a list of the categories applied to this test
+
+
+
+
+ Gets a list of any child tests
+
+
+
+
+ True if this is a suite, false if a test case
+
+
+
+
+ Gets the Properties dictionary for this test
+
+
+
+
+ Counts the test cases that would be run if this
+ test were executed using the provided filter.
+
+ The filter to apply
+ A count of test cases
+
+
+
+ TestName encapsulates all info needed to identify and
+ locate a test that has been loaded by a runner. It consists
+ of a three components: the simple name of the test, an int
+ id that is unique to a given tree of tests and an int
+ runner id that identifies the particular runner that
+ holds the test instance.
+
+
+
+
+ ID that uniquely identifies the test
+
+
+
+
+ The simple name of the test, without qualification
+
+
+
+
+ The fully qualified name of the test
+
+
+
+
+ Gets or sets the TestID that uniquely identifies this test
+
+
+
+
+ Gets the ID for the runner that created the test from
+ the TestID, or returns -1 if the TestID is null.
+
+
+
+
+ Gets or sets the simple name of the test
+
+
+
+
+ Gets or sets the full (qualified) name of the test
+
+
+
+
+ Get the string representation of this test name, incorporating all
+ the components of the name.
+
+
+
+
+ Parse a string representation of a TestName,
+ returning a TestName.
+
+ The string to parse
+ A TestName
+
+
+
+ Compares two TestNames for equality
+
+ the other TestID
+ True if the two TestIDs are equal
+
+
+
+ Calculates a hashcode for this TestID
+
+ The hash code.
+
+
+
+ Override ToString() to display the UniqueName
+
+
+
+
+
+
+ Override the == operator
+
+
+
+
+
+
+
+
+
+
+ Override the != operator
+
+
+
+
+
+
+
+
+
+
+ Returns a duplicate of this TestName
+
+
+
+
+
+
+ TestNode represents a single test or suite in the test hierarchy.
+ TestNode holds common info needed about a test and represents a
+ single node - either a test or a suite - in the hierarchy of tests.
+ TestNode extends TestInfo, which holds all the information with
+ the exception of the list of child classes. When constructed from
+ a Test, TestNodes are always fully populated with child TestNodes.
+ Like TestInfo, TestNode is purely a data class, and is not able
+ to execute tests.
+
+
+
+
+ For a test suite, the child tests or suites
+ Null if this is not a test suite
+
+
+
+
+ Construct from an ITest
+
+ Test from which a TestNode is to be constructed
+
+
+
+ Construct a TestNode given a TestName and an
+ array of child tests.
+
+ The TestName of the new test
+ An array of tests to be added as children of the new test
+
+
+
+ Gets the parent test of the current test
+
+
+
+
+ Array of child tests, null if this is a test case.
+
+
+
+
+ The TestOutput class holds a unit of output from
+ a test to either stdOut or stdErr
+
+
+
+
+ Construct with text and an ouput destination type
+
+ Text to be output
+ Destination of output
+
+
+
+ Return string representation of the object for debugging
+
+
+
+
+
+
+ Get the text
+
+
+
+
+ Get the output type
+
+
+
+
+ Enum representing the output destination
+ It uses combinable flags so that a given
+ output control can accept multiple types
+ of output. Normally, each individual
+ output uses a single flag value.
+
+
+
+
+ Send output to stdOut
+
+
+
+
+ Send output to stdErr
+
+
+
+
+ Send output to Trace
+
+
+
+
+ Send output to Log
+
+
+
+
+ Represents the manner in which test assemblies are
+ distributed across processes.
+
+
+
+
+ Use the default setting, depending on the runner
+ and the nature of the tests to be loaded.
+
+
+
+
+ Run tests directly in the NUnit process
+
+
+
+
+ Run tests in a single separate process
+
+
+
+
+ Run tests in a separate process per assembly
+
+
+
+
+ Represents the manner in which test assemblies use
+ AppDomains to provide isolation
+
+
+
+
+ Use the default setting, depending on the runner
+ and the nature of the tests to be loaded.
+
+
+
+
+ Don't create a test domain - run in the primary AppDomain
+
+
+
+
+ Run tests in a single separate test domain
+
+
+
+
+ Run tests in a separate domain per assembly
+
+
+
+
+ TestPackage holds information about a set of tests to
+ be loaded by a TestRunner. It may represent a single
+ assembly or a set of assemblies. It supports selection
+ of a single test fixture for loading.
+
+
+
+
+ Construct a package, specifying the name of the package.
+ If the package name is an assembly file type (dll or exe)
+ then the resulting package represents a single assembly.
+ Otherwise it is a container for multiple assemblies.
+
+ The name of the package
+
+
+
+ Construct a package, specifying the name to be used
+ and a list of assemblies.
+
+ The package name, used to name the top-level test node
+ The list of assemblies comprising the package
+
+
+
+ Gets the name of the package
+
+
+
+
+ Gets the full name of the package, which is usually
+ the path to the NUnit project used to create the it
+
+
+
+
+ The BasePath to be used in loading the assemblies
+
+
+
+
+ The configuration file to be used
+
+
+
+
+ Addditional directories to be probed when loading assemblies
+
+
+
+
+ Indicates whether the probing path should be generated
+ automatically based on the list of assemblies.
+
+
+
+
+ Assemblies to be loaded. At least one must be specified.
+
+
+
+
+ Return true if the package represents a single assembly.
+ No root node is displayed in that case.
+
+
+
+
+ Fully qualified name of test to be loaded. If not
+ specified, all the tests in the assemblies are loaded.
+
+
+
+
+ Gets the dictionary of settings for this TestPackage
+
+
+
+
+ Return the value of a setting or a default.
+
+ The name of the setting
+ The default value
+
+
+
+
+
+ Return the value of a string setting or a default.
+
+ The name of the setting
+ The default value
+
+
+
+
+
+ Return the value of a bool setting or a default.
+
+ The name of the setting
+ The default value
+
+
+
+
+
+ Return the value of an int setting or a default.
+
+ The name of the setting
+ The default value
+
+
+
+
+
+ Return the value of a enum setting or a default.
+
+ The name of the setting
+ The default value
+
+
+
+
+
+ The TestResult class represents
+ the result of a test and is used to
+ communicate results across AppDomains.
+
+
+
+
+ Indicates the result of the test
+
+
+
+
+ Indicates the location of a failure
+
+
+
+
+ The elapsed time for executing this test
+
+
+
+
+ The test that this result pertains to
+
+
+
+
+ The stacktrace at the point of failure
+
+
+
+
+ Message giving the reason for failure
+
+
+
+
+ List of child results
+
+
+
+
+ Number of asserts executed by this test
+
+
+
+
+ Construct a test result given a TestInfo
+
+ The test to be used
+
+
+
+ Construct a TestResult given an ITest
+
+
+
+
+
+
+ Construct a TestResult given a TestName
+
+ A TestName
+
+
+
+ Gets the ResultState of the test result, which
+ indicates the success or failure of the test.
+
+
+
+
+ Gets the stage of the test in which a failure
+ or error occured.
+
+
+
+
+ Indicates whether the test executed
+
+
+
+
+ Gets the name of the test result
+
+
+
+
+ Gets the full name of the test result
+
+
+
+
+ Gets the test associated with this result
+
+
+
+
+ Indicates whether the test ran successfully
+
+
+
+
+ Indicates whether the test failed
+
+
+
+
+ Indicates whether the test had an error (as opposed to a failure)
+
+
+
+
+ Gets a description associated with the test
+
+
+
+
+ Gets the elapsed time for running the test
+
+
+
+
+ Gets the message associated with a test
+ failure or with not running the test
+
+
+
+
+ Gets any stacktrace associated with an
+ error or failure.
+
+
+
+
+ Gets or sets the count of asserts executed
+ when running the test.
+
+
+
+
+ Return true if this result has any child results
+
+
+
+
+ Gets a list of the child results of this TestResult
+
+
+
+
+ Mark the test as succeeding
+
+
+
+
+ Mark the test as succeeding and set a message
+
+
+
+
+ Mark the test as ignored.
+
+ The reason the test was not run
+
+
+
+ Mark the test as ignored.
+
+ The ignore exception that was thrown
+
+
+
+ Mark the test as ignored.
+
+ The reason the test was not run
+ Stack trace giving the location of the command
+
+
+
+ Mark the test as skipped.
+
+ The reason the test was not run
+
+
+
+ Mark the test a not runnable with a reason
+
+ The reason the test is invalid
+
+
+
+ Mark the test as not runnable due to a builder exception
+
+ The exception thrown by the builder or an addin
+
+
+
+ Set the result of the test
+
+ The ResultState to use in the result
+ The reason the test was not run
+ Stack trace giving the location of the command
+ The location of the failure, if any
+
+
+
+ Set the result of the test
+
+ The ResultState to use in the result
+ The reason the test was not run
+ Stack trace giving the location of the command
+
+
+
+ Set the result of the test.
+
+ The ResultState to use in the result
+ The exception that caused this result
+ The site at which an error or failure occured
+
+
+
+ Mark the test as a failure due to an
+ assertion having failed.
+
+ Message to display
+ Stack trace giving the location of the failure
+
+
+
+ Mark the test as a failure due to an
+ assertion having failed.
+
+ Message to display
+ Stack trace giving the location of the failure
+ The site of the failure
+
+
+
+ Marks the result as an error due to an exception thrown
+ by the test.
+
+ The exception that was caught
+
+
+
+ Marks the result as an error due to an exception thrown
+ from the indicated FailureSite.
+
+ The exception that was caught
+ The site from which it was thrown
+
+
+
+ Add a child result
+
+ The child result to be added
+
+
+
+ The TestRunner Interface allows client code, such as the NUnit console and
+ gui runners, to load and run tests. This is the lowest level interface generally
+ supported for running tests and is implemented by the RemoteTestRunner class in
+ the NUnit core as well as by other classes running on the client side.
+ The Load method is used to load a suite of tests from one or more
+ assemblies, returning a tree of TestNodes to the caller.
+ The CountTestCases family of methods returns the number of test cases in the
+ loaded suite, either in its entirety or by using a filter to count a subset of tests.
+ The Run family of methods performs a test run synchronously, returning a TestResult
+ or TestResult[] to the caller. If provided, an EventListener interface will be
+ notified of significant events in the running of the tests. A filter may be used
+ to run a subset of the tests.
+ BeginRun and EndRun provide a simplified form of the asynchronous invocation
+ pattern used in many places within the .NET framework. Because the current
+ implementation allows only one run to be in process at a time, an IAsyncResult
+ is not used at this time.
+ Methods to cancel a run and to wait for a run to complete are also provided. The
+ result of the last run may be obtained by querying the TestResult property.
+
+
+
+
+ TestRunners are identified by an ID. So long as there
+ is only one test runner or a single chain of test runners,
+ the default id of 0 may be used. However, any client that
+ creates multiple runners must ensure that each one has a
+ unique ID in order to locate and run specific tests.
+
+
+
+
+ Running indicates whether a test is in progress. To retrieve the
+ results from an asynchronous test run, wait till Running is false.
+
+
+
+
+ Returns information about loaded assemblies
+
+
+
+
+ The loaded test, converted to a tree of TestNodes so they can be
+ serialized and marshalled to a remote client.
+
+
+
+
+ Result of the last test run.
+
+
+
+
+ Load the assemblies in a test package
+
+ The test package to be loaded
+ True if the tests were loaded successfully, otherwise false
+
+
+
+ Unload all tests previously loaded
+
+
+
+
+ Count Test Cases using a filter
+
+ The filter to apply
+ The number of test cases found
+
+
+
+ Run selected tests and return a test result. The test is run synchronously,
+ and the listener interface is notified as it progresses. Arguments control whether
+ trace and log output are passed back to the caller.
+
+ Interface to receive EventListener notifications.
+ The filter to apply when running the tests
+ If true, trace output is returned as a TestOutput event
+ The threshold for log output to be returned as a TestOutput event
+
+
+
+ Start a run of selected tests. The tests are run aynchronously and the
+ listener interface is notified as it progresses. Arguments control whether
+ trace and log output are passed back to the caller.
+
+ Interface to receive EventListener notifications.
+ The filter to apply when running the tests
+ If true, trace output is returned as a TestOutput event
+ The threshold for log output to be returned as a TestOutput event
+
+
+
+ Wait for an asynchronous run to complete and return the result.
+
+ A TestResult for the entire run
+
+
+
+ Cancel the test run that is in progress. For a synchronous run,
+ a client wanting to call this must create a separate run thread.
+
+
+
+
+ Wait for the test run in progress to complete. For a synchronous run,
+ a client wanting to call this must create a separate run thread. In
+ particular, a gui client calling this method is likely to hang, since
+ events will not be able to invoke methods on the gui thread.
+
+
+
+
+ Enumeration expressing the level of log messages to be
+ captured by NUnit and sent to the runner. These happen
+ to match the standard levels used by log4net, but will
+ be translated for any other loggers we support.
+
+
+
+ No logging
+
+
+ Severe error beyond which continuation is not possible
+
+
+ Error that may allow continuation
+
+
+ A warning message
+
+
+ An informational message
+
+
+ Messages used for debugging
+
+
+ All of the preceding plus more detailled messages if supported
+
+
+
diff --git a/frameworks/csharp/nunit/nunit.framework.dll b/frameworks/csharp/nunit/nunit.framework.dll
new file mode 100755
index 00000000..956c32c2
Binary files /dev/null and b/frameworks/csharp/nunit/nunit.framework.dll differ
diff --git a/frameworks/csharp/nunit/nunit.util.dll b/frameworks/csharp/nunit/nunit.util.dll
new file mode 100755
index 00000000..cd862ff0
Binary files /dev/null and b/frameworks/csharp/nunit/nunit.util.dll differ
diff --git a/frameworks/csharp/nunit/pnunit-agent.exe b/frameworks/csharp/nunit/pnunit-agent.exe
new file mode 100755
index 00000000..d27864d0
Binary files /dev/null and b/frameworks/csharp/nunit/pnunit-agent.exe differ
diff --git a/frameworks/csharp/nunit/pnunit-agent.exe.config b/frameworks/csharp/nunit/pnunit-agent.exe.config
new file mode 100644
index 00000000..2da8776d
--- /dev/null
+++ b/frameworks/csharp/nunit/pnunit-agent.exe.config
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frameworks/csharp/nunit/pnunit-launcher.exe b/frameworks/csharp/nunit/pnunit-launcher.exe
new file mode 100755
index 00000000..5ab38513
Binary files /dev/null and b/frameworks/csharp/nunit/pnunit-launcher.exe differ
diff --git a/frameworks/csharp/nunit/pnunit-launcher.exe.config b/frameworks/csharp/nunit/pnunit-launcher.exe.config
new file mode 100644
index 00000000..2da8776d
--- /dev/null
+++ b/frameworks/csharp/nunit/pnunit-launcher.exe.config
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frameworks/csharp/nunit/pnunit.framework.dll b/frameworks/csharp/nunit/pnunit.framework.dll
new file mode 100755
index 00000000..faff8f89
Binary files /dev/null and b/frameworks/csharp/nunit/pnunit.framework.dll differ
diff --git a/frameworks/csharp/nunit/pnunit.tests.dll b/frameworks/csharp/nunit/pnunit.tests.dll
new file mode 100755
index 00000000..49b7ff8f
Binary files /dev/null and b/frameworks/csharp/nunit/pnunit.tests.dll differ
diff --git a/frameworks/csharp/nunit/runpnunit.bat b/frameworks/csharp/nunit/runpnunit.bat
new file mode 100644
index 00000000..f41cb5a6
--- /dev/null
+++ b/frameworks/csharp/nunit/runpnunit.bat
@@ -0,0 +1,3 @@
+start pnunit-agent 8080 .
+start pnunit-agent 8081 .
+pnunit-launcher test.conf
diff --git a/frameworks/csharp/nunit/test.conf b/frameworks/csharp/nunit/test.conf
new file mode 100644
index 00000000..63cc7bd4
--- /dev/null
+++ b/frameworks/csharp/nunit/test.conf
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+ Testing
+
+
+ Testing
+ pnunit.tests.dll
+ TestLibraries.Testing.EqualTo19
+ $agent_host:8080
+
+
+
+
+
+
+ Parallel_Tests
+
+
+ ParallelTest_A_Test
+ pnunit.tests.dll
+ TestLibraries.ParallelExample.ParallelTest_A
+ $agent_host:8080
+
+
+ 2
+
+
+
+ ParallelTest_B_Test
+ pnunit.tests.dll
+ TestLibraries.ParallelExample.ParallelTest_B
+ $agent_host:8080
+
+ 1
+
+
+
+
+
+
+
+
+ Parallel_Barriers
+
+
+ Parallel_Barriers_TestA
+ pnunit.tests.dll
+ TestLibraries.ParallelExampleWithBarriers.ParallelTestWithBarriersA
+ $agent_host:8080
+
+
+
+ START_BARRIER
+ WAIT_BARRIER
+
+
+
+ Parallel_Barriers_TestB
+ pnunit.tests.dll
+ TestLibraries.ParallelExampleWithBarriers.ParallelTestWithBarriersB
+ $agent_host:8081
+
+
+
+ START_BARRIER
+ WAIT_BARRIER
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frameworks/haskell/Test/CodeWars/BlackList.hs b/frameworks/haskell/Test/CodeWars/BlackList.hs
index b51b09b1..e1bd88fc 100644
--- a/frameworks/haskell/Test/CodeWars/BlackList.hs
+++ b/frameworks/haskell/Test/CodeWars/BlackList.hs
@@ -95,7 +95,7 @@ unName (Symbol name) = name
-- | Check that an ImportSpec matches a symbol
importSpecMatchesSymbol :: ImportSpec -> String -> Bool
-(IVar x) `importSpecMatchesSymbol` y = (unName x) == y
+(IVar _ x) `importSpecMatchesSymbol` y = (unName x) == y
(IAbs x) `importSpecMatchesSymbol` y = (unName x) == y
(IThingAll x) `importSpecMatchesSymbol` y = (unName x) == y
(IThingWith x cnames) `importSpecMatchesSymbol` y =
diff --git a/frameworks/haskell/Test/CodeWars/Formatters.hs b/frameworks/haskell/Test/CodeWars/Formatters.hs
index d4347572..d01909a0 100644
--- a/frameworks/haskell/Test/CodeWars/Formatters.hs
+++ b/frameworks/haskell/Test/CodeWars/Formatters.hs
@@ -22,10 +22,10 @@ codewars :: Formatter
codewars = do
specdoc {
headerFormatter = return ()
-, exampleGroupStarted = \n _ name -> do
+, exampleGroupStarted = \nesting name -> do
-- separate groups with an empty line
- unless (n == 0) newParagraph
- writeLine $ join ["", name]
+ -- TODO: Handel nesting
+ writeLine $ join $ ["", name]
, exampleGroupDone = Test.Hspec.Formatters.writeLine ""
@@ -45,7 +45,7 @@ specdoc {
writeLine $ printf "%1.4f seconds" time
} where
formatFailure :: FailureRecord -> FormatM ()
- formatFailure (FailureRecord _ reason) =
+ formatFailure (FailureRecord {failureRecordMessage = reason}) =
unless (null err) $ writeLine err
where
err = either
diff --git a/frameworks/haskell/Test/CodeWars/Runner.hs b/frameworks/haskell/Test/CodeWars/Runner.hs
index a7101bd6..8594d99d 100644
--- a/frameworks/haskell/Test/CodeWars/Runner.hs
+++ b/frameworks/haskell/Test/CodeWars/Runner.hs
@@ -6,7 +6,7 @@ import Test.CodeWars.Formatters (codewars)
import qualified System.Exit
import Control.Monad (unless)
import "hspec" Test.Hspec (Spec)
-import "hspec" Test.Hspec.Runner ( hspecWith
+import "hspec" Test.Hspec.Runner ( hspecWithResult
, defaultConfig
, Config
( configFormatter
@@ -15,10 +15,10 @@ import "hspec" Test.Hspec.Runner ( hspecWith
hspec :: Spec -> IO ()
hspec spec = withArgs [] $ do
- r <- hspecWith config spec
+ r <- hspecWithResult config spec
unless (summaryFailures r == 0)
System.Exit.exitFailure
where
config =
- defaultConfig { configFormatter = codewars
+ defaultConfig { configFormatter = Just codewars
, configFastFail = True}
diff --git a/frameworks/haskell/Test/Hspec.hs b/frameworks/haskell/Test/Hspec.hs
index 2a2d109b..37dc09e0 100644
--- a/frameworks/haskell/Test/Hspec.hs
+++ b/frameworks/haskell/Test/Hspec.hs
@@ -9,6 +9,14 @@ module Test.Hspec (
, Spec
, describe
, it
+ , context
+ , example
+ , pending
+ , pendingWith
+ , before
+ , after
+ , around
+ , parallel
-- QuickCheck
, property
diff --git a/frameworks/javascript/cw-2.js b/frameworks/javascript/cw-2.js
index f562379a..cbb1fb63 100644
--- a/frameworks/javascript/cw-2.js
+++ b/frameworks/javascript/cw-2.js
@@ -9,6 +9,7 @@ try
}
var util = require('util');
+ var deepEquals = require('lodash').isEqual;
var fnToString = Function.toString;
Function.prototype.toString = function ()
@@ -303,34 +304,50 @@ try
{
this.assertNotEquals(this.inspect(actual), this.inspect(expected), msg, options)
},
- assertEquals: function (actual, expected, msg, options)
- {
- if (actual !== expected)
- {
+ assertEquals: function (actual, expected, msg, options) {
+ if (actual !== expected) {
msg = _message('Expected: ' + Test.inspect(expected) + ', instead got: ' + Test.inspect(actual), msg);
Test.expect(false, msg, options);
}
- else
- {
+ else {
options = options || {};
options.successMsg = options.successMsg || 'Value == ' + Test.inspect(expected);
Test.expect(true, null, options);
}
},
- assertNotEquals: function (a, b, msg, options)
- {
- if (a === b)
- {
+ assertNotEquals: function (a, b, msg, options) {
+ if (a === b) {
msg = _message('Not Expected: ' + Test.inspect(a), msg);
Test.expect(false, msg, options);
}
- else
- {
+ else {
options = options || {};
options.successMsg = options.successMsg || 'Value != ' + Test.inspect(b);
Test.expect(true, null, options);
}
},
+ assertDeepEquals: function (actual, expected, msg, options) {
+ if (deepEquals(actual, expected)) {
+ options = options || {};
+ options.successMsg = options.successMsg || 'Value deep equals ' + Test.inspect(expected);
+ Test.expect(true, null, options);
+ }
+ else {
+ msg = _message('Expected: ' + Test.inspect(expected) + ', instead got: ' + Test.inspect(actual), msg);
+ Test.expect(false, msg, options);
+ }
+ },
+ assertNotDeepEquals: function (actual, expected, msg, options) {
+ if (!deepEquals(actual, expected)) {
+ options = options || {};
+ options.successMsg = options.successMsg || 'Value not deep equals ' + Test.inspect(expected);
+ Test.expect(true, null, options);
+ }
+ else {
+ msg = _message('Value should not deep equal ' + Test.inspect(actual), msg);
+ Test.expect(false, msg, options);
+ }
+ },
expectNoError: function (msg, fn)
{
if (!fn)
@@ -402,6 +419,14 @@ try
{
return array[~~(array.length * Math.random())]
},
+ escapeHtml: function (html) {
+ return String(html)
+ .replace(/&/g, '&')
+ .replace(/"/g, '"')
+ .replace(/'/g, ''')
+ .replace(//g, '>');
+ },
Error: function (message)
{
this.name = "TestError";
diff --git a/frameworks/osx/format_failure.sh b/frameworks/osx/format_failure.sh
new file mode 100755
index 00000000..5725da93
--- /dev/null
+++ b/frameworks/osx/format_failure.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+sed -n "/^\/tmp\/xcode\/[^\/]*\/${1}\//,\$p" |
+sed -e "s/^.*\/${1}\/[^\.]*\.swift$//" \
+ -e "s/^.*\/${1}\/[^\.]*\.m$//" \
+ -e "s/^.*\/${1}\/\([^\.]*\.swift\)/\1/" \
+ -e "s/^.*\/${1}\/\([^\.]*\.m\)/\1/" \
+ -e "/^\*\* BUILD FAILED \*\*/,\$d" |
+grep -v ${1} |
+grep -v 'cd /tmp/xcode'
diff --git a/frameworks/osx/format_output.sh b/frameworks/osx/format_output.sh
new file mode 100755
index 00000000..ec5e18db
--- /dev/null
+++ b/frameworks/osx/format_output.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+sed -e "1,/^Test Suite '${1}.xctest' started at/d" \
+ -e "s/\(^Test Suite '[^']*' started at .*\)$/\1/" \
+ -e "s/\(^Test Case '[^']*' started.\)$/\1/" \
+ -e "s/\(^Test Case '[^']*' failed [^(]*\)(\([^)]*\))\.$/\1\2/" \
+ -e "s/\(^Test Case '[^']*' passed [^(]*\)(\([^)]*\))\.$/\1\2/" \
+ -e $'s//\\\n/g' \
+ -e "s/${1//-/_}\.//g" \
+ -e "s/^.*\/${1}\/\([^\.]*\.swift\)/\1/" \
+ -e "s/^.*\/${1}\/\([^\.]*\.m\)/\1/" \
+ -e "/^Test Suite '${1}.xctest' failed/,\$d" \
+ -e "/^Test Suite '${1}.xctest' passed/,\$d" |
+perl -pe "s/(Test Suite '[^']*' [pf]a[is][ls]ed.*)\n/\1<:LF:>/"
diff --git a/frameworks/osx/objc.sb b/frameworks/osx/objc.sb
new file mode 100644
index 00000000..2d33e0ae
--- /dev/null
+++ b/frameworks/osx/objc.sb
@@ -0,0 +1,24 @@
+;; A sandbox file for `sandbox-exec`
+;;
+;; Unofficial Manual: http://reverse.put.as/wp-content/uploads/2011/09/Apple-Sandbox-Guide-v1.0.pdf
+;; Examples: /usr/share/sandbox/*.sb
+;;
+
+(version 1)
+
+; Doesn't work, maybe someday...
+(debug all)
+
+; Deny everything by default
+(deny default)
+
+(allow file-read-data file-read-metadata
+ ; System dynamic libraries
+ (regex #"^/usr/lib/.*\.dylib$")
+ ; Read access to frameworks
+ (subpath "/System/Library/Frameworks")
+ (subpath "/System/Library/PrivateFrameworks")
+)
+
+; Allow us to execute compiled executables
+(allow process-exec (regex #"/tmp/objc/[0-9a-z\-]+/main"))
diff --git a/frameworks/osx/ready_template.sh b/frameworks/osx/ready_template.sh
new file mode 100755
index 00000000..72be01d2
--- /dev/null
+++ b/frameworks/osx/ready_template.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+set -euo pipefail
+
+mkdir -p /tmp/xcode
+DIR=$( cd "$(dirname "${BASH_SOURCE[0]}")" && pwd )
+NEW_TEMPDIR=$(mktemp -d /tmp/xcode/XXXXXXXXXXXXXXXXXXXXXXX)
+
+# Set up the XCode project
+UUID=X$(uuidgen)
+mkdir -p ${NEW_TEMPDIR}/runner.xcodeproj/xcuserdata/${USER}.xcuserdatad/xcschemes
+sed -e "s/runner-test/${UUID}/g" ${DIR}/runner_template/runner.xcodeproj/xcuserdata/template.xcuserdatad/xcschemes/runner-test.xcscheme > ${NEW_TEMPDIR}/runner.xcodeproj/xcuserdata/${USER}.xcuserdatad/xcschemes/${UUID}.xcscheme
+sed -e "s/runner-test/${UUID}/g" ${DIR}/runner_template/runner.xcodeproj/project.pbxproj > ${NEW_TEMPDIR}/runner.xcodeproj/project.pbxproj
+cp -a ${DIR}/runner_template/runner-test/ ${NEW_TEMPDIR}/${UUID}/
+
+# Build the xcode project a head of time
+( cd ${NEW_TEMPDIR} ;
+ xcodebuild clean build -project runner.xcodeproj/ -scheme ${UUID} -destination 'platform=OS X,arch=x86_64') > /dev/null 2>&1
+
+echo ${NEW_TEMPDIR}
diff --git a/frameworks/osx/run_template.sh b/frameworks/osx/run_template.sh
new file mode 100755
index 00000000..b748ac45
--- /dev/null
+++ b/frameworks/osx/run_template.sh
@@ -0,0 +1,78 @@
+#!/bin/bash
+set -euo pipefail
+
+mkdir -p /tmp/xcode
+DIR=$( cd "$(dirname "${BASH_SOURCE[0]}")" && pwd )
+
+if [ ! -z ${RUNNER_TMPDIR+x} ] ; then
+ if [ ! -r "$RUNNER_TMPDIR" -o ! -d "$RUNNER_TMPDIR" ] ; then
+ echo "$RUNNER_TMPDIR is not a readable directory!"
+ false
+ fi
+else
+ RUNNER_TMPDIR=$(${DIR}/ready_template.sh)
+fi
+
+#trap 'rm -rf $RUNNER_TMPDIR' EXIT
+CODEDIR=$(ls -d $RUNNER_TMPDIR/X*/)
+TMPPBXPROJ=$(mktemp /tmp/project.pbxproj.XXXXXXXXXXXXXX)
+trap 'rm -f $TMPPBXPROJ' EXIT
+mv $CODE $CODEDIR/$(basename $CODE)
+mv $FIXTURE $CODEDIR/$(basename $FIXTURE)
+[ ! -z ${SETUP+x} ] && cp $SETUP $CODEDIR/$(basename $SETUP)
+
+case $language in
+ objc)
+ mv $CODE_HEADER $CODEDIR/$(basename $CODE_HEADER)
+ if [ ! -z ${SETUP+x} ]; then
+ mv $SETUP_HEADER $CODEDIR/$(basename $SETUP_HEADER)
+ sed -e "s/code.m/$(basename $CODE)/g" \
+ -e "s/code.h/$(basename $CODE_HEADER)/g" \
+ -e "s/setup.m/$(basename $SETUP)/g" \
+ -e "s/setup.h/$(basename $SETUP_HEADER)/g" \
+ -e "s/test.m/$(basename $FIXTURE)/g" \
+ $RUNNER_TMPDIR/runner.xcodeproj/project.pbxproj > $TMPPBXPROJ
+ else
+ sed -e "s/code.m/$(basename $CODE)/g" \
+ -e "s/code.h/$(basename $CODE_HEADER)/g" \
+ -e "s/test.m/$(basename $FIXTURE)/g" \
+ $RUNNER_TMPDIR/runner.xcodeproj/project.pbxproj > $TMPPBXPROJ
+
+ fi
+ ;;
+ swift)
+ if [ ! -z ${SETUP+x} ]; then
+ sed -e "s/code.swift/$(basename $CODE)/g" \
+ -e "s/setup.swift/$(basename $SETUP)/g" \
+ -e "s/test.swift/$(basename $FIXTURE)/g" \
+ $RUNNER_TMPDIR/runner.xcodeproj/project.pbxproj > $TMPPBXPROJ
+ else
+ sed -e "s/code.swift/$(basename $CODE)/g" \
+ -e "s/test.swift/$(basename $FIXTURE)/g" \
+ $RUNNER_TMPDIR/runner.xcodeproj/project.pbxproj > $TMPPBXPROJ
+ fi
+ ;;
+
+ *)
+ echo "Language \"$language\" not supported!"
+ false
+ ;;
+esac
+
+OUTPUT=$(mktemp /tmp/output.XXXXXXXXXXXXXX)
+trap 'rm -f $OUTPUT' EXIT
+mv $TMPPBXPROJ $RUNNER_TMPDIR/runner.xcodeproj/project.pbxproj
+
+EXIT_CODE=0
+if (cd $RUNNER_TMPDIR ;
+ xcodebuild build -project runner.xcodeproj/ -scheme $(basename $CODEDIR) -destination 'platform=OS X,arch=x86_64' && \
+ sandbox-exec -f ${DIR}/xcode.sb /usr/bin/xcodebuild test -project runner.xcodeproj/ \
+ -scheme $(basename $CODEDIR) \
+ -destination 'platform=OS X,arch=x86_64') &> $OUTPUT || \
+ EXIT_CODE=1 && \
+ grep "Test Suite '$(basename $CODEDIR).xctest'" $OUTPUT &> /dev/null; then
+ ${DIR}/format_output.sh $(basename $CODEDIR) < $OUTPUT
+else
+ ${DIR}/format_failure.sh $(basename $CODEDIR) < $OUTPUT
+fi
+exit ${EXIT_CODE}
diff --git a/frameworks/osx/runner_template/runner-test/Info.plist b/frameworks/osx/runner_template/runner-test/Info.plist
new file mode 100644
index 00000000..899d535f
--- /dev/null
+++ b/frameworks/osx/runner_template/runner-test/Info.plist
@@ -0,0 +1,3 @@
+
+
+
diff --git a/frameworks/osx/runner_template/runner-test/code.h b/frameworks/osx/runner_template/runner-test/code.h
new file mode 100644
index 00000000..e69de29b
diff --git a/frameworks/osx/runner_template/runner-test/code.m b/frameworks/osx/runner_template/runner-test/code.m
new file mode 100644
index 00000000..e69de29b
diff --git a/frameworks/osx/runner_template/runner-test/code.swift b/frameworks/osx/runner_template/runner-test/code.swift
new file mode 100644
index 00000000..e69de29b
diff --git a/frameworks/osx/runner_template/runner-test/setup.h b/frameworks/osx/runner_template/runner-test/setup.h
new file mode 100644
index 00000000..e69de29b
diff --git a/frameworks/osx/runner_template/runner-test/setup.m b/frameworks/osx/runner_template/runner-test/setup.m
new file mode 100644
index 00000000..e69de29b
diff --git a/frameworks/osx/runner_template/runner-test/setup.swift b/frameworks/osx/runner_template/runner-test/setup.swift
new file mode 100644
index 00000000..e69de29b
diff --git a/frameworks/osx/runner_template/runner-test/test.m b/frameworks/osx/runner_template/runner-test/test.m
new file mode 100644
index 00000000..e69de29b
diff --git a/frameworks/osx/runner_template/runner-test/test.swift b/frameworks/osx/runner_template/runner-test/test.swift
new file mode 100644
index 00000000..e69de29b
diff --git a/frameworks/osx/runner_template/runner.xcodeproj/.gitignore b/frameworks/osx/runner_template/runner.xcodeproj/.gitignore
new file mode 100644
index 00000000..413a0d61
--- /dev/null
+++ b/frameworks/osx/runner_template/runner.xcodeproj/.gitignore
@@ -0,0 +1 @@
+project.xcworkspace/
diff --git a/frameworks/osx/runner_template/runner.xcodeproj/project.pbxproj b/frameworks/osx/runner_template/runner.xcodeproj/project.pbxproj
new file mode 100644
index 00000000..ad9c30d3
--- /dev/null
+++ b/frameworks/osx/runner_template/runner.xcodeproj/project.pbxproj
@@ -0,0 +1,294 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 34123B421A38FBEB00E26285 /* test.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34123B411A38FBEB00E26285 /* test.swift */; };
+ 34A5CBAE1A45140D005AC3FC /* setup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A5CBAD1A45140D005AC3FC /* setup.swift */; };
+ 34A5CBB01A4517FA005AC3FC /* code.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A5CBAF1A4517FA005AC3FC /* code.swift */; };
+ 34A5CBB31A45193A005AC3FC /* code.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A5CBB21A45193A005AC3FC /* code.m */; };
+ 34A5CBB61A451AF8005AC3FC /* setup.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A5CBB51A451AF8005AC3FC /* setup.m */; };
+ 34A5CBBB1A451BF6005AC3FC /* test.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A5CBBA1A451BF6005AC3FC /* test.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 34123B3D1A38FBEB00E26285 /* runner-test.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "runner-test.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 34123B401A38FBEB00E26285 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ 34123B411A38FBEB00E26285 /* test.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = test.swift; sourceTree = ""; };
+ 34A5CBAD1A45140D005AC3FC /* setup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = setup.swift; sourceTree = ""; };
+ 34A5CBAF1A4517FA005AC3FC /* code.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = code.swift; sourceTree = ""; };
+ 34A5CBB21A45193A005AC3FC /* code.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = code.m; sourceTree = ""; };
+ 34A5CBB41A451A92005AC3FC /* code.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = code.h; sourceTree = ""; };
+ 34A5CBB51A451AF8005AC3FC /* setup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = setup.m; sourceTree = ""; };
+ 34A5CBB71A451B20005AC3FC /* setup.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = setup.h; sourceTree = ""; };
+ 34A5CBBA1A451BF6005AC3FC /* test.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = test.m; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 34123B3A1A38FBEB00E26285 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 34123B261A38FA6E00E26285 = {
+ isa = PBXGroup;
+ children = (
+ 34123B3E1A38FBEB00E26285 /* runner-test */,
+ 34123B301A38FA6E00E26285 /* Products */,
+ );
+ sourceTree = "";
+ };
+ 34123B301A38FA6E00E26285 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 34123B3D1A38FBEB00E26285 /* runner-test.xctest */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 34123B3E1A38FBEB00E26285 /* runner-test */ = {
+ isa = PBXGroup;
+ children = (
+ 34123B411A38FBEB00E26285 /* test.swift */,
+ 34123B3F1A38FBEB00E26285 /* Supporting Files */,
+ 34A5CBAD1A45140D005AC3FC /* setup.swift */,
+ 34A5CBAF1A4517FA005AC3FC /* code.swift */,
+ 34A5CBB21A45193A005AC3FC /* code.m */,
+ 34A5CBB41A451A92005AC3FC /* code.h */,
+ 34A5CBB51A451AF8005AC3FC /* setup.m */,
+ 34A5CBB71A451B20005AC3FC /* setup.h */,
+ 34A5CBBA1A451BF6005AC3FC /* test.m */,
+ );
+ path = "runner-test";
+ sourceTree = "";
+ };
+ 34123B3F1A38FBEB00E26285 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 34123B401A38FBEB00E26285 /* Info.plist */,
+ );
+ name = "Supporting Files";
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 34123B3C1A38FBEB00E26285 /* runner-test */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 34123B431A38FBEB00E26285 /* Build configuration list for PBXNativeTarget "runner-test" */;
+ buildPhases = (
+ 34123B391A38FBEB00E26285 /* Sources */,
+ 34123B3A1A38FBEB00E26285 /* Frameworks */,
+ 34123B3B1A38FBEB00E26285 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "runner-test";
+ productName = "runner-test";
+ productReference = 34123B3D1A38FBEB00E26285 /* runner-test.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 34123B271A38FA6E00E26285 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0610;
+ ORGANIZATIONNAME = Entrefuse;
+ TargetAttributes = {
+ 34123B3C1A38FBEB00E26285 = {
+ CreatedOnToolsVersion = 6.1.1;
+ };
+ };
+ };
+ buildConfigurationList = 34123B2A1A38FA6E00E26285 /* Build configuration list for PBXProject "runner" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 34123B261A38FA6E00E26285;
+ productRefGroup = 34123B301A38FA6E00E26285 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 34123B3C1A38FBEB00E26285 /* runner-test */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 34123B3B1A38FBEB00E26285 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 34123B391A38FBEB00E26285 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 34A5CBB31A45193A005AC3FC /* code.m in Sources */,
+ 34A5CBB01A4517FA005AC3FC /* code.swift in Sources */,
+ 34A5CBB61A451AF8005AC3FC /* setup.m in Sources */,
+ 34123B421A38FBEB00E26285 /* test.swift in Sources */,
+ 34A5CBAE1A45140D005AC3FC /* setup.swift in Sources */,
+ 34A5CBBB1A451BF6005AC3FC /* test.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 34123B341A38FA6E00E26285 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.9;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = macosx;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ };
+ name = Debug;
+ };
+ 34123B351A38FA6E00E26285 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.9;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+ 34123B441A38FBEB00E26285 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ COMBINE_HIDPI_IMAGES = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(DEVELOPER_FRAMEWORKS_DIR)",
+ "$(inherited)",
+ );
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "runner-test/Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ };
+ name = Debug;
+ };
+ 34123B451A38FBEB00E26285 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_MODULES = YES;
+ COMBINE_HIDPI_IMAGES = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(DEVELOPER_FRAMEWORKS_DIR)",
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "runner-test/Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 34123B2A1A38FA6E00E26285 /* Build configuration list for PBXProject "runner" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 34123B341A38FA6E00E26285 /* Debug */,
+ 34123B351A38FA6E00E26285 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 34123B431A38FBEB00E26285 /* Build configuration list for PBXNativeTarget "runner-test" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 34123B441A38FBEB00E26285 /* Debug */,
+ 34123B451A38FBEB00E26285 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 34123B271A38FA6E00E26285 /* Project object */;
+}
diff --git a/frameworks/osx/runner_template/runner.xcodeproj/xcuserdata/template.xcuserdatad/xcschemes/runner-test.xcscheme b/frameworks/osx/runner_template/runner.xcodeproj/xcuserdata/template.xcuserdatad/xcschemes/runner-test.xcscheme
new file mode 100644
index 00000000..da58e4bb
--- /dev/null
+++ b/frameworks/osx/runner_template/runner.xcodeproj/xcuserdata/template.xcuserdatad/xcschemes/runner-test.xcscheme
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frameworks/osx/swift.sb b/frameworks/osx/swift.sb
new file mode 100644
index 00000000..cfbf23fa
--- /dev/null
+++ b/frameworks/osx/swift.sb
@@ -0,0 +1,26 @@
+;; A sandbox file for `sandbox-exec`
+;;
+;; Unofficial Manual: http://reverse.put.as/wp-content/uploads/2011/09/Apple-Sandbox-Guide-v1.0.pdf
+;; Examples: /usr/share/sandbox/*.sb
+;;
+
+(version 1)
+
+; Doesn't work, maybe someday...
+(debug all)
+
+; Deny everything by default
+(deny default)
+
+(allow file-read-data file-read-metadata
+ ; System dynamic libraries
+ (regex #"^/usr/lib/.*\.dylib$")
+ ; Swift libraries
+ (regex #"^/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/.*\.dylib$")
+ ; Read access to frameworks
+ (subpath "/System/Library/Frameworks")
+ (subpath "/System/Library/PrivateFrameworks")
+)
+
+; Allow us to execute compiled executables
+(allow process-exec (regex #"/tmp/swift/[0-9a-z\-]+/main"))
diff --git a/frameworks/osx/xcode.sb b/frameworks/osx/xcode.sb
new file mode 100644
index 00000000..5d36df9e
--- /dev/null
+++ b/frameworks/osx/xcode.sb
@@ -0,0 +1,73 @@
+;; -*- mode: Lisp; fill-column: 80; comment-column: 0; -*-
+;; A sandbox file for `sandbox-exec`
+;;
+;; Unofficial Manual: http://reverse.put.as/wp-content/uploads/2011/09/Apple-Sandbox-Guide-v1.0.pdf
+;; Examples: /usr/share/sandbox/*.sb
+;;
+
+(version 1)
+
+;; Doesn't work, maybe someday...
+(debug all)
+
+;; Deny everything by default
+(deny default)
+
+(allow sysctl-read)
+(allow process-exec
+ (subpath "/Applications/Xcode.app/Contents")
+ (literal "/bin/sh"))
+(allow process-fork)
+
+(allow file-read-data file-read-metadata)
+
+(allow file-write*
+ ; XCTest's lock file
+ (regex #"^/private/tmp/XCTest-[a-zA-Z0-9]+$")
+
+ ; User files stored by XCode
+ (regex #"^/Users/[^/]+/Library/Developer/Xcode/DerivedData/runner-[a-z]+/Logs/Build/[A-Z0-9\-]+\.xcactivitylog$")
+ (regex #"^/Users/[^/]+/Library/Developer/Xcode/DerivedData/runner-[a-z]+/Logs/Build/Cache.db$")
+ (regex #"^/Users/[^/]+/Library/Developer/Xcode/DerivedData/runner-[a-z]+/Logs/Test/[A-Z0-9\-]+\.xcactivitylog$")
+ (regex #"^/Users/[^/]+/Library/Developer/Xcode/DerivedData/runner-[a-z]+/Logs/Test/[A-Z0-9\-]+_TestSummaries\.plist$")
+ (regex #"^/Users/[^/]+/Library/Developer/Xcode/DerivedData/runner-[a-z]+/TestResults/[0-9 \-\.]+\.xctestresults$")
+ (regex #"^/Users/[^/]+/Library/Developer/Xcode/DerivedData/runner-[a-z]+/TestResults/[0-9 \-\.]+\.xctestresults/results.plist$")
+
+ ; Private temp files
+ (regex #"^/private/var/folders/[^/]+/[^/]+/C/mds/mdsDirectory\.db_?$")
+ (regex #"^/private/var/folders/[^/]+/[^/]+/C/mds/mdsObject\.db_?$")
+ (regex #"^/private/var/folders/[^/]+/[^/]+/T/TemporaryItems/\(A\ Document\ Being\ Saved\ By\ xcodebuild\ [0-9]+\)/$")
+ (regex #"^/private/var/folders/[^/]+/[^/]+/T/TemporaryItems/\(A\ Document\ Being\ Saved\ By\ xcodebuild\ [0-9]+\)/Cache\.db$")
+ (regex #"^/private/var/folders/[^/]+/[^/]+/T/TemporaryItems/\(A\ Document\ Being\ Saved\ By\ xcodebuild\ [0-9]+\)/results\.plist$")
+ (regex #"^/private/var/folders/[^/]+/[^/]+/T/TemporaryItems/\(A\ Document\ Being\ Saved\ By\ xcodebuild\ [0-9]+\)$")
+ (regex #"^/private/var/folders/[^/]+/[^/]+/T/TemporaryItems/\(A\ Document\ Being\ Saved\ By\ xcodebuild\ [0-9]+\)/[A-Z0-9\-]+_TestSummaries\.plist$")
+ (regex #"^/private/var/folders/[^/]+/[^/]+/T/com\.apple\.dt\.XCTest-status/Session-[A-Z 0-9:\-_]+\.log$"))
+
+(allow file-ioctl file-write-data
+ (literal "/dev/ptmx")
+ (regex #"^/dev/ttys[0-9]+$"))
+
+(allow file-write-xattr file-read-xattr
+ (regex #"^/Users/[^/]+/Library/Developer/Xcode/DerivedData/ModuleCache$")
+ (regex #"^/Users/[^/]+/Library/Developer/Xcode/DerivedData/runner-[^/]+$")
+ (regex #"^/Users/[^/]+/Library/Developer/Xcode/DerivedData/runner-[^/]+/Build/.*$"))
+
+(allow file-write-data
+ (regex #"^/Users/[^/]+/Library/Developer/Xcode/DerivedData/runner-[^/]+/Build/Intermediates/runner.build/Debug/[^/]+\.build/dgph$")
+ (regex #"^/private/var/folders/[^/]+/[^/]+/C/mds/mds\.lock$"))
+
+
+(allow process-exec
+ (literal "/usr/bin/xcodebuild")
+ (subpath "/Applications/Xcode.app"))
+
+(allow network-bind network-outbound (regex #"^/private/tmp/XCTest-.*$"))
+(allow network-inbound network-outbound (local tcp4 "localhost:*"))
+
+(allow mach-priv-task-port)
+(allow mach-lookup
+ (global-name "com.apple.FSEvents")
+ (global-name "com.apple.backupd.sandbox.xpc")
+ (global-name "com.apple.metadata.mds")
+ (global-name "com.apple.system.opendirectoryd.libinfo")
+ (global-name "com.apple.system.opendirectoryd.membership"))
diff --git a/frameworks/python3 b/frameworks/python3
deleted file mode 120000
index fd42b688..00000000
--- a/frameworks/python3
+++ /dev/null
@@ -1 +0,0 @@
-python/
\ No newline at end of file
diff --git a/frameworks/python3/cw-2.py b/frameworks/python3/cw-2.py
new file mode 100644
index 00000000..3a69f7b8
--- /dev/null
+++ b/frameworks/python3/cw-2.py
@@ -0,0 +1,56 @@
+from __future__ import print_function
+
+class AssertException(Exception):
+ pass
+
+
+def format_message(message):
+ return message.replace("\n", "<:LF:>")
+
+
+def expect(passed=None, message=None, allow_raise=False):
+ if passed:
+ print("Test Passed")
+ else:
+ message = message or "Value is not what was expected"
+ print("{0}".format(message))
+ if allow_raise:
+ raise AssertException(message)
+
+
+def assert_equals(actual, expected, message=None, allow_raise=True):
+ equals_msg = "{0} should equal {1}".format(repr(actual), repr(expected))
+ if message is None:
+ message = equals_msg
+ else:
+ message += ": " + equals_msg
+
+ expect(actual == expected, message, allow_raise)
+
+
+def assert_not_equals(actual, expected, message=None, allow_raise=True):
+ equals_msg = \
+ "{0} should not equal {1}".format(repr(actual), repr(expected))
+ if message is None:
+ message = equals_msg
+ else:
+ message += ": " + equals_msg
+
+ expect(actual != expected, message, allow_raise)
+
+
+def expect_error(message, function):
+ passed = False
+ try:
+ function()
+ except:
+ passed = True
+ expect(passed, message)
+
+
+def describe(message):
+ print("{0}".format(format_message(message)))
+
+
+def it(message):
+ print("{0}".format(format_message(message)))
diff --git a/frameworks/python3/unittestwrapper.py b/frameworks/python3/unittestwrapper.py
new file mode 100644
index 00000000..1f1ec1a7
--- /dev/null
+++ b/frameworks/python3/unittestwrapper.py
@@ -0,0 +1,18 @@
+from __future__ import print_function
+import unittest
+
+def formatMessage(message):
+ return "{0}".format(message).replace("\n", "<:LF:>")
+
+class CwTestResult(unittest.TestResult):
+ def addSuccess(self, test):
+ print("Test Passed")
+ super(CwTestResult, self).addSuccess(test)
+
+ def addFailure(self, test, err):
+ print("" + formatMessage(err[1]))
+ super(CwTestResult, self).addFailure(test, err)
+
+ def addError(self, test, err):
+ print("Unhandled Exception: " + formatMessage(err[1]))
+ super(CwTestResult, self).addError(test, err)
diff --git a/frameworks/ruby/cwrspecformatter.rb b/frameworks/ruby/cwrspecformatter.rb
new file mode 100644
index 00000000..b1e8e7fb
--- /dev/null
+++ b/frameworks/ruby/cwrspecformatter.rb
@@ -0,0 +1,70 @@
+class CwRSpecFormatter
+ LF_TOKEN = "<:LF:>"
+
+ def initialize(output)
+ @output = output
+ end
+
+ def format_message(s)
+ s.gsub("\n", LF_TOKEN)
+ end
+
+ def format_exception(notification)
+ format_message(notification.exception.message.split("\\n/tmp").first)
+ end
+
+ def format_backtrace(notification)
+ case SpecFormatter.backtrace_format
+ when :simple
+ trace = notification.formatted_backtrace
+ .map {|chunk| chunk.split('`').last.split("'").first }
+
+ if trace.any?
+ "#{LF_TOKEN}Simplified backtrace: #{trace.join(' -> ')}"
+ else
+ ''
+ end
+
+ when :detailed
+ LF_TOKEN + notification.formatted_backtrace.join(LF_TOKEN)
+ end
+ end
+
+ RSpec::Core::Formatters.register self, :example_group_started, :example_group_finished, :example_started, :example_passed, :example_failed, :message
+ def example_group_started(notification)
+ @output.puts "#{format_message(notification.group.description)}"
+ end
+
+ def example_group_finished(notification)
+ @output.puts ""
+ end
+
+ def example_started(notification)
+ @output.puts "#{format_message(notification.example.description)}"
+ end
+ def example_passed(notification)
+ @output.puts "Test Passed"# + format_message(notification.example.description)
+ end
+ def example_failed(notification)
+ if notification.exception.is_a? RSpec::Expectations::ExpectationNotMetError
+ @output.puts "#{format_exception(notification)}"
+ else
+ @output.puts "#{format_exception(notification)}#{format_backtrace(notification)}"
+ end
+ end
+ def message(notification)
+ @output.puts format_message(notification.message)
+ end
+end
+
+# public version
+class SpecFormatter
+ def self.backtrace_format
+ @backtrace_format ||= :simple
+ end
+
+ def self.backtrace_format=(value)
+ @backtrace_format = value
+ end
+end
+
diff --git a/jvm-runner/Dockerfile b/jvm-runner/Dockerfile
deleted file mode 100644
index e53a54d0..00000000
--- a/jvm-runner/Dockerfile
+++ /dev/null
@@ -1,37 +0,0 @@
-# BUILD-USING: docker build -t codewars/jvm-runner .
-# EXAMPLE USAGE: docker run -i -a stdin -a stdout -a stderr --rm codewars/jvm-runner <<< '{"language": "clojure", "solution": "(println 42)"}'
-
-# Pull base image.
-FROM dockerfile/ubuntu
-
-# Install Java 8
-# RUN apt-get install -y default-jre-headless default-jdk # default is OpenJDK6
-RUN add-apt-repository ppa:webupd8team/java
-RUN apt-get update
-# http://askubuntu.com/a/190674
-RUN echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
- echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
-RUN apt-get install -y oracle-java8-installer
-
-# Install Leiningen
-RUN curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > /usr/bin/lein
-RUN chmod a+x /usr/bin/lein
-RUN LEIN_ROOT=true lein --version
-
-# ADD codewarrior user
-RUN useradd -s /usr/sbin/nologin -m -d /home/codewarrior -p codewarrior codewarrior
-
-# ADD cli-runner and install node deps
-ADD . /codewars-jvm
-WORKDIR /codewars-jvm
-RUN [ -e target/jvm-runner-0.1.1-standalone.jar ] || LEIN_ROOT=true lein do clean, test, uberjar
-
-# Set the user and workdir
-WORKDIR /tmp
-USER codewarrior
-
-# Run the uberjar
-ENV TIMEOUT 2000
-ENV USER codewarrior
-ENV HOME /home/codewarrior
-ENTRYPOINT ["java", "-jar", "/codewars-jvm/target/jvm-runner-0.1.1-standalone.jar"]
diff --git a/jvm-runner/project.clj b/jvm-runner/project.clj
index 3c7a62d9..7dd0b830 100644
--- a/jvm-runner/project.clj
+++ b/jvm-runner/project.clj
@@ -2,34 +2,16 @@
:description "JVM Runner for codewars"
:url "http://www.codewars.com/"
:javac-target "1.8"
- :dependencies [[org.clojure/clojure "1.6.0"]
- [cheshire "5.3.1"] ; JSON
- [korma "0.3.0"] ; ORM
- [com.h2database/h2 "1.3.170"] ; In Memory Database
- [org.xerial/sqlite-jdbc "3.7.15-M1"] ; SQLite
- [com.novemberain/monger "2.0.0"] ; Monger
- [com.taoensso/carmine "2.7.0" :exclusions [org.clojure/clojure]] ; Carmine
- [org.clojure/core.async "0.1.346.0-17112a-alpha"] ; Go-Routines
- [org.clojure/test.check "0.5.9"] ; Generative Testing
- [prismatic/schema "0.2.6"] ; Schema Verification
- [instaparse "1.3.4"] ; BNF Parsers
- [org.clojure/core.logic "0.8.8"] ; Logic Programming
- [org.clojure/core.match "0.2.1"] ; Pattern Matching
- [prismatic/plumbing "0.3.3"] ; Random Awesomeness
- [slingshot "0.11.0"] ; Advanced Exceptions
- [compojure "1.1.9"] ; Routing WebServer
- [clj-http "1.0.0"] ; HTTP Client
- [enlive "1.1.5"] ; HTML templating
- [hiccup "1.0.5"] ; Clojure HTML DSL
- [junit/junit "4.11"] ; JUnit
- [org.codehaus.groovy/groovy-all "2.3.6"] ; Groovy
- [environ "0.5.0"] ; Environment Variables
- ]
+ :dependencies
+ [[org.clojure/clojure "1.6.0"]
+ [cheshire "5.3.1"] ; JSON
+ [junit/junit "4.11"] ; JUnit
+ [org.codehaus.groovy/groovy-all "2.3.6"] ; Groovy
+ [environ "0.5.0"] ; Environment Variables
+ ]
:plugins [[lein-environ "0.5.0"]]
- :source-paths ["src/clojure"]
+ :source-paths ["src/clojure"]
:java-source-paths ["src/java"]
- :env {:timeout "2000"}
- :profiles {:uberjar {:aot :all
- :omit-source true
- :javac-options ["-g:none"]}}
+ :env {:timeout "10000"
+ :zmq-socket "ipc:///tmp/codewars"}
:main codewars.core)
diff --git a/jvm-runner/schema.json b/jvm-runner/schema.json
deleted file mode 100644
index 2b366491..00000000
--- a/jvm-runner/schema.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "title": "CodeWars Runner Schema",
- "type": "object",
- "properties": {
- "language": {
- "description": "The language the kata was written in",
- "type": "string"
- },
- "solution": {
- "description": "The codewars kata solution code",
- "type": "string"
- },
- "fixture": {
- "description": "The test suite for the solution code",
- "type": "string"
- },
- "setup": {
- "description": "Additional setup code",
- "type": "string"
- }
- },
- "required": ["language", "solution"]
-}
diff --git a/jvm-runner/src/clojure/codewars/clojure/test.clj b/jvm-runner/src/clojure/codewars/clojure/test.clj
index 91a02010..fd56f3bd 100644
--- a/jvm-runner/src/clojure/codewars/clojure/test.clj
+++ b/jvm-runner/src/clojure/codewars/clojure/test.clj
@@ -9,8 +9,7 @@
`(->
(with-out-str ~@body)
(clojure.string/replace "\n" "<:LF:>")
- (println)
- clojure.test/with-test-out))
+ (println)))
(defn- print-context []
(when (seq *testing-contexts*)
diff --git a/jvm-runner/src/clojure/codewars/core.clj b/jvm-runner/src/clojure/codewars/core.clj
index ded24971..cea63627 100644
--- a/jvm-runner/src/clojure/codewars/core.clj
+++ b/jvm-runner/src/clojure/codewars/core.clj
@@ -3,13 +3,17 @@
[codewars.runners :refer [run]]
[codewars.kill-switch :refer [with-timeout]]
[environ.core :refer [env]]
+ [codewars.warm-up :refer [warm-up]]
[codewars.runners.groovy]
[codewars.runners.clojure]
[codewars.runners.java])
(:gen-class))
-(defn- flush-out [val]
- (flush)
+(defn- flush-out [& [val]]
+ (. *out* (flush))
+ (. *err* (flush))
+ (.flush (System/out))
+ (.flush (System/err))
val)
(defn- fail [e]
@@ -19,13 +23,19 @@
(-> (str sw)
(clojure.string/replace "\n" "<:LF:>")
println))
+ (flush-out)
(System/exit 1))
+(def timeout ((fnil #(Integer/parseInt %) "5000") (env :timeout)))
+
(defn -main
"Listens to *in* for a JSON message, parses it and calls the appropriate runner"
- [& _]
- (let [ms ((fnil #(Integer/parseInt %) "5000") (env :timeout))
- input (json/parse-stream *in* true)]
+ [& args]
+ (when (not (empty? args))
+ (warm-up)
+ (apply println args)
+ (flush))
+ (let [input (json/parse-stream *in* true)]
(try
- (flush-out (with-timeout ms (run input)))
+ (flush-out (with-timeout timeout (run input)))
(catch Exception e (fail e)))))
diff --git a/jvm-runner/src/clojure/codewars/runners.clj b/jvm-runner/src/clojure/codewars/runners.clj
index 4913a562..4ed67756 100644
--- a/jvm-runner/src/clojure/codewars/runners.clj
+++ b/jvm-runner/src/clojure/codewars/runners.clj
@@ -1,8 +1,8 @@
(ns codewars.runners)
-(defmulti solution-only :language)
+(defmulti code-only :language)
(defmulti full-project :language)
-(defmethod solution-only :default
+(defmethod code-only :default
[{:keys [:language]}]
(throw (IllegalArgumentException.
(format "Language %s is not implemented"
@@ -15,8 +15,8 @@
(pr-str language)))))
(defn run
- "Run solution code or a test-fixture."
+ "Run code or a test-fixture."
[opts]
(if (nil? (:fixture opts))
- (solution-only opts)
+ (code-only opts)
(full-project opts)))
diff --git a/jvm-runner/src/clojure/codewars/runners/clojure.clj b/jvm-runner/src/clojure/codewars/runners/clojure.clj
index 2abec38d..ab95331b 100644
--- a/jvm-runner/src/clojure/codewars/runners/clojure.clj
+++ b/jvm-runner/src/clojure/codewars/runners/clojure.clj
@@ -1,35 +1,22 @@
(ns codewars.runners.clojure
- (:require [codewars.runners :refer [solution-only full-project]]
- [codewars.util :as util]
- [codewars.clojure.test]
- [clojure.java.io :as io])
- (:import [codewars.java TempDir])
- (:refer-clojure :exclude (add-classpath)))
+ (:require
+ [codewars.runners :refer [code-only full-project]]
+ [codewars.clojure.test]))
-(defn- add-classpath
- "Add a url path to the system class loader"
- [new-classpath]
- (let [field (aget (.getDeclaredFields java.net.URLClassLoader) 0)]
- (.setAccessible field true)
- (let [ucp (.get field (ClassLoader/getSystemClassLoader))]
- (.addURL ucp (io/as-url new-classpath)))))
+(defn name-space
+ [code]
+ (if-let [result (re-find #"^\(ns\s+([A-Z|a-z](?:[a-z|A-Z|0-9|-]|\.[A-Z|a-z])*)\W" code)]
+ (-> result second symbol)
+ (throw (java.text.ParseException. (str "Failed to parse clojure namespace in code:\n\n" code "\n\n") 0))))
-(defmethod solution-only "clojure"
- [{:keys [:setup :solution]}]
- (let [dir (TempDir/create "clojure")
- solution-file (io/file dir "solution.clj")]
- (when (not (empty? setup)) (util/write-code! "clojure" dir setup))
- (spit solution-file solution)
- (add-classpath dir)
- (load-file (str solution-file))))
+(defmethod code-only "clojure"
+ [{:keys [:setup :code]}]
+ (when (not (empty? setup)) (load-string setup))
+ (load-string code))
(defmethod full-project "clojure"
- [{:keys [:setup :solution :fixture]}]
- (let [dir (TempDir/create "clojure")
- {fixture-ns :class-name}
- (util/write-code! "clojure" dir fixture)]
- (when (not (empty? setup)) (util/write-code! "clojure" dir setup))
- (util/write-code! "clojure" dir solution)
- (add-classpath dir)
- (require fixture-ns)
- (codewars.clojure.test/run-tests fixture-ns)))
+ [{:keys [:setup :code :fixture]}]
+ (when (not (empty? setup)) (load-string setup))
+ (load-string code)
+ (load-string fixture)
+ (codewars.clojure.test/run-tests (name-space fixture)))
diff --git a/jvm-runner/src/clojure/codewars/runners/groovy.clj b/jvm-runner/src/clojure/codewars/runners/groovy.clj
index 68d085f4..e3d68796 100644
--- a/jvm-runner/src/clojure/codewars/runners/groovy.clj
+++ b/jvm-runner/src/clojure/codewars/runners/groovy.clj
@@ -1,8 +1,10 @@
(ns codewars.runners.groovy
- (:require [codewars.runners :refer [solution-only]])
+ (:require [codewars.runners :refer [code-only]])
(:import [groovy.lang GroovyShell]))
-(defmethod solution-only "groovy"
- [{:keys [:setup :solution]}]
- (when (not (nil? setup)) (throw (Exception. "Setup code is not supported")))
- (.evaluate (GroovyShell.) solution))
+(defmethod code-only "groovy"
+ [{:keys [:setup :code]}]
+ (let [shell (GroovyShell.)]
+ ;; TODO: Test setup code
+ (when (not (nil? setup)) (.evaluate shell setup))
+ (.evaluate shell code)))
diff --git a/jvm-runner/src/clojure/codewars/runners/java.clj b/jvm-runner/src/clojure/codewars/runners/java.clj
index 9543e7f9..ee37769e 100644
--- a/jvm-runner/src/clojure/codewars/runners/java.clj
+++ b/jvm-runner/src/clojure/codewars/runners/java.clj
@@ -1,36 +1,98 @@
(ns codewars.runners.java
- (:require [codewars.runners :refer [solution-only full-project]]
- [codewars.clojure.test]
- [clojure.java.io :as io]
- [codewars.util :refer [write-code!]])
- (:import [codewars.java TempDir]
- [java.net URLClassLoader]
- [javax.tools ToolProvider]
- [java.io ByteArrayOutputStream]
- [org.junit.runner JUnitCore]
- [codewars.java CwRunListener]))
+ (:require [codewars.runners :refer [code-only full-project]]
+ [codewars.clojure.test])
+ (:import
+ [javax.tools ToolProvider SimpleJavaFileObject SimpleJavaFileObject ForwardingJavaFileManager]
+ [java.net URI]
+ [java.io PrintWriter ByteArrayOutputStream]
+ [org.junit.runner JUnitCore]
+ [codewars.java CwRunListener]))
-(defn- compile!
- "Compile files using the java compiler"
- [& files]
- (let [out-stream (ByteArrayOutputStream.)
- err-stream (ByteArrayOutputStream.)
- compilation-result
- (. (ToolProvider/getSystemJavaCompiler)
- run nil out-stream err-stream
- (into-array (map str files)))]
- (-> out-stream str print)
- (if (zero? compilation-result)
- 0
- (throw (RuntimeException. (str err-stream))))))
+(defn class-name
+ "Determine the class name of some java code (include package)"
+ [code]
+ (let [package-name (second (re-find #"\bpackage\s+([A-Z|a-z](?:[a-z|A-Z|0-9|_]|\.[A-Z|a-z])*)\W" code))
+ class-name (second (re-find #"\bclass\s+([A-Z][a-z|A-Z|0-9|_]*)\W" code))]
+ (cond
+ (nil? class-name) (throw (java.text.ParseException.
+ (str "Failed to parse java class in code:\n\n" code "\n\n") 0))
+ (nil? package-name) class-name
+ :else (str package-name "." class-name))))
-(defn- load-class
- "Load a java class in a specified directory"
- [dir class-name]
- (let [class-loader
- (URLClassLoader/newInstance
- (into-array [(io/as-url dir)]))]
- (Class/forName (name class-name) true class-loader)))
+(def ^:private source-kind javax.tools.JavaFileObject$Kind/SOURCE)
+(def ^:private class-kind javax.tools.JavaFileObject$Kind/CLASS)
+
+(defn- class-uri [class-name kind]
+ (URI. (str "string:///"
+ (.replace class-name "." "/")
+ (.extension kind))))
+
+(defn- source-code-file
+ "In-memory file for storing source code"
+ [code]
+ (proxy
+ [SimpleJavaFileObject]
+ [(class-uri (class-name code) source-kind)
+ source-kind]
+ (getCharContent [_] code)))
+
+(defn- byte-code-file
+ "In-memory file for storing byte-code for class"
+ [class-name kind]
+ (let [out (ByteArrayOutputStream.)]
+ (proxy
+ [SimpleJavaFileObject]
+ [(class-uri class-name kind) kind]
+ (getBytes [] (.toByteArray out))
+ (openOutputStream [] out))))
+
+(defn- byte-code-manager
+ "File-manager for in-memory class byte-codes"
+ [standard-manager]
+ (let [class-codes (atom {})
+ class-loader
+ ;; TODO: Use a lighter ClassLoader than this
+ (proxy [clojure.lang.DynamicClassLoader] []
+ (findClass [class-name]
+ (if-let [byte-data (get @class-codes [class-name class-kind])]
+ ;; TODO: Such hacks... :(
+ (let [byte-code (.toByteArray (.openOutputStream byte-data))]
+ (proxy-super defineClass class-name byte-code nil))
+ (throw
+ (java.lang.ClassNotFoundException.
+ (str "Could not find "
+ [class-name class-kind]
+ " among possibilities: "
+ (keys @class-codes)))))))]
+ (proxy
+ [ForwardingJavaFileManager]
+ [standard-manager]
+ (getClassLoader [_] class-loader)
+ (getJavaFileForOutput [_ class-name kind _]
+ (get (swap! class-codes assoc [class-name kind] (byte-code-file class-name kind))
+ [class-name kind])))))
+
+(def ^:private compiler (ToolProvider/getSystemJavaCompiler))
+
+(def ^:private file-manager (byte-code-manager (.getStandardFileManager compiler nil nil nil)))
+
+(defn compile-and-load
+ [class-name & codes]
+ (let [files (map source-code-file codes)]
+ (with-open [err-stream (ByteArrayOutputStream.)]
+ (if(-> compiler (.getTask (PrintWriter. err-stream) file-manager nil nil nil files) .call)
+ (-> file-manager (.getClassLoader nil) (.loadClass class-name))
+ (throw (RuntimeException. (str err-stream)))))))
+
+(defmethod code-only "java"
+ [{:keys [:setup :code]}]
+ (let [code-class-name (class-name code)]
+ (-> (if (nil? setup)
+ (compile-and-load code-class-name code)
+ (compile-and-load code-class-name code setup))
+ (.getDeclaredMethod "main" (into-array [(Class/forName "[Ljava.lang.String;")]))
+ (doto (.setAccessible true))
+ (.invoke nil (into-array [(into-array String [])])))))
(defn- run-junit-tests
"Run a JUnit test using the Codewars Formatter for a given fixture-class"
@@ -40,33 +102,10 @@
(codewars.clojure.test/time
(.run runner (into-array [fixture-class])))))
-(defn- file-names
- "Filter a sequence of files writen by write-code! and output their names"
- [& files]
- (for [{:keys [:file-name]} files
- :when (not (nil? file-name))]
- file-name))
-
-(defmethod solution-only "java"
- [{:keys [:setup :solution]}]
- (let [dir (TempDir/create "java")
- setup (when (not (empty? setup)) (write-code! "java" dir setup))
- solution (write-code! "java" dir solution)
- files (file-names setup solution)]
- (apply compile! files)
- (-> solution
- :class-name
- (->> (load-class dir))
- (.getDeclaredMethod "main" (into-array [(Class/forName "[Ljava.lang.String;")]))
- (doto (.setAccessible true))
- (.invoke nil (into-array [(into-array String [])])))))
-
(defmethod full-project "java"
- [{:keys [:fixture :setup :solution]}]
- (let [dir (TempDir/create "java")
- fixture (write-code! "java" dir fixture)
- setup (when (not (empty? setup)) (write-code! "java" dir setup))
- solution (write-code! "java" dir solution)
- files (file-names fixture setup solution)]
- (apply compile! files)
- (->> fixture :class-name (load-class dir) run-junit-tests)))
+ [{:keys [:fixture :setup :code]}]
+ (let [fixture-class-name (class-name fixture)]
+ (run-junit-tests
+ (if (nil? setup)
+ (compile-and-load fixture-class-name code fixture)
+ (compile-and-load fixture-class-name code fixture setup)))))
diff --git a/jvm-runner/src/clojure/codewars/util.clj b/jvm-runner/src/clojure/codewars/util.clj
deleted file mode 100644
index ba5db10c..00000000
--- a/jvm-runner/src/clojure/codewars/util.clj
+++ /dev/null
@@ -1,53 +0,0 @@
-(ns codewars.util
- (:require [clojure.java.io :as io]))
-
-(def ^:private
- language-data
- {"clojure" {:pattern #"^\(ns\s+([A-Z|a-z](?:[a-z|A-Z|0-9|-]|\.[A-Z|a-z])*)\W"
- :extension "clj"}
-
- "java" {:pattern #"\bclass\s+([A-Z][a-z|A-Z|0-9|_]*)\W"
- :extension "java"}
-
- "groovy" {:pattern #"^package\s+([a-z](?:[a-z|A-Z|0-9|-]|\.[a-z])*)\W"
- :extension "groovy"}})
-
-(defn class-name
- "Infer the appropriate class or namespace name from code given a language"
- [language code]
- (let [{:keys [:pattern]} (get language-data language)]
- ;; TODO: Filter comments
- (if-let [name (->> code (re-find pattern) second symbol)]
- name
- (throw
- (IllegalArgumentException.
- (format "Could not infer class or namespace name for language %s from code:\n%s\n" (pr-str language) code))))))
-
-(defn class-name-to-file-name
- "Create a file name for a class or namespace name given a language"
- [language class-name]
- (let [{:keys [:extension]} (get language-data language)]
- (-> class-name
- name
- (clojure.string/replace "-" "_")
- ;; TODO: not platform independent...
- (clojure.string/replace "." "/")
- (str "." extension)
- io/file)))
-
-(defn write-code!
- "Write code to an appropriate file in a specified directory given a language"
- [language dir code]
- (let [class-name (class-name language code)
- base-name (class-name-to-file-name language class-name)
- file-name (io/file dir base-name)]
- (if (.exists file-name)
- (throw
- (UnsupportedOperationException.
- (format "Could not write to file %s, because that file already exists. Perhaps it already contains the setup or test fixture code?\ncode:\n%s" (pr-str base-name) code)))
- ;; else
- (do
- (-> file-name .getParentFile .mkdirs)
- (spit file-name code)
- {:file-name file-name
- :class-name class-name}))))
diff --git a/jvm-runner/test/codewars/test/utils.clj b/jvm-runner/src/clojure/codewars/utils.clj
similarity index 67%
rename from jvm-runner/test/codewars/test/utils.clj
rename to jvm-runner/src/clojure/codewars/utils.clj
index 7f1b4d7b..8f86aa59 100644
--- a/jvm-runner/test/codewars/test/utils.clj
+++ b/jvm-runner/src/clojure/codewars/utils.clj
@@ -1,4 +1,4 @@
-(ns codewars.test.utils
+(ns codewars.utils
"A small collection of utilities for testing"
(:import [java.io PrintStream ByteArrayOutputStream StringWriter]))
@@ -20,6 +20,18 @@
~@body
(str s#))))
+(defmacro with-all-out-str
+ "A version of clojure.core/with-out-str suitable for wrapping java's System.out"
+ [& body]
+ `(let [original-out# (PrintStream. System/out)
+ byte-out# (ByteArrayOutputStream.)
+ s# (StringWriter.)]
+ (binding [*out* s#]
+ (-> byte-out# (PrintStream.) System/setOut)
+ ~@body
+ (System/setOut original-out#)
+ (str byte-out# s#))))
+
(defmacro with-err-str
"A version of clojure.core/with-out-str for *err*"
[& body]
diff --git a/jvm-runner/src/clojure/codewars/warm_up.clj b/jvm-runner/src/clojure/codewars/warm_up.clj
new file mode 100644
index 00000000..7b06184a
--- /dev/null
+++ b/jvm-runner/src/clojure/codewars/warm_up.clj
@@ -0,0 +1,64 @@
+(ns codewars.warm-up
+ (:require [codewars.runners :refer [run]]
+ [codewars.runners.java]
+ [codewars.runners.clojure]
+ [codewars.utils :refer :all]
+ [clojure.string :refer [split join capitalize]]))
+
+(def replacements
+ {\0 \G, \1 \H, \2 \I, \3 \J, \4 \K, \5 \L, \6 \M, \7 \N,
+ \8 \O, \9 \P, \a \A, \b \B, \c \C, \d \D, \e \E, \f \F
+ \- \-})
+
+(defn- random-name-space []
+ (let [ [class-name & package-path]
+ (-> (java.util.UUID/randomUUID)
+ str
+ vec
+ (->> (map replacements)
+ (apply str))
+ (split #"-")
+ (->> (map capitalize)))]
+ {:class-name class-name
+ :package (join "." package-path)}))
+
+(defn clojure-code-warm-up
+ []
+ (run {:language "clojure"
+ :code ":warm-up-payload"}))
+
+(defn java-code-warm-up
+ []
+ (let [{:keys [:class-name :package]} (random-name-space)]
+ (run {:language "java"
+ :code (format "package %s ; class %s { static int main(String [] args) {return 7;} }" package class-name)})))
+
+(defn clojure-test-warm-up
+ []
+ (let [setup-namespace (join "." (vals (random-name-space)))
+ code-namespace (join "." (vals (random-name-space)))
+ fixture-namespace (join "." (vals (random-name-space)))]
+ (with-all-out-str
+ (run {:language "clojure"
+ :setup (format "(ns %s) (def x :test-payload)" setup-namespace)
+ :code (format "(ns %s (:require [%s :as setup])) (def y setup/x)" code-namespace setup-namespace)
+ :fixture (format "(ns %s (:require [%s :as code] [clojure.test :refer :all])) (deftest test-payload-test (prn :in-test-payload-test) (testing \"foooo\" (is (= :test-payload code/y))))" fixture-namespace code-namespace)}))))
+(defn java-test-warm-up
+ []
+ (let [setup (random-name-space)
+ code (random-name-space)
+ fixture (random-name-space)]
+ (with-all-out-str
+ (run
+ {:language "java"
+ :setup (format "package %s ; public class %s { public static String payload() {return \"test payload\";}}" (:package setup) (:class-name setup))
+ :code (format "package %1$s ; public class %2$s { public %2$s(){} public String payloadForwarder(){return %3$s.%4$s.payload();}}" (:package code) (:class-name code) (:package setup) (:class-name setup)),
+ :fixture (format "package %1$s ; import static org.junit.Assert.assertEquals; import org.junit.Test; import org.junit.runners.JUnit4; public class %2$s { public %2$s (){} @Test public void codeAndSetupAndFixture(){ %3$s.%4$s s = new %3$s.%4$s(); assertEquals(\"Verifying test payload\", \"test payload\", s.payloadForwarder()); System.out.println(\"test success\");}}"
+ (:package fixture) (:class-name fixture)
+ (:package code) (:class-name code))}))))
+
+(defn warm-up []
+ (clojure-code-warm-up)
+ (clojure-test-warm-up)
+ (java-code-warm-up)
+ (java-test-warm-up))
diff --git a/jvm-runner/src/java/codewars/java/CwRunListener.java b/jvm-runner/src/java/codewars/java/CwRunListener.java
index 7db252aa..e3e1c779 100644
--- a/jvm-runner/src/java/codewars/java/CwRunListener.java
+++ b/jvm-runner/src/java/codewars/java/CwRunListener.java
@@ -10,7 +10,11 @@ public class CwRunListener extends RunListener
public void testFailure(Failure failure)
{
failed = true;
- System.out.println(String.format("%s<:LF:>", formatMessage(failure.getMessage())));
+ String msg = failure.getMessage();
+ if (msg == null) {
+ msg = "Unknown Test Failure";
+ }
+ System.out.println(String.format("%s<:LF:>", formatMessage(msg)));
}
public void testStarted(Description description)
{
@@ -23,9 +27,14 @@ public void testFinished(Description description)
{
System.out.println("Test Passed<:LF:>");
}
+ System.out.println("");
}
private static String formatMessage(String s)
{
+ if(s == null){
+ s = "";
+ }
+
return s.replaceAll("\n", "<:LF:>");
}
}
diff --git a/jvm-runner/src/java/codewars/java/TempDir.java b/jvm-runner/src/java/codewars/java/TempDir.java
deleted file mode 100644
index 8abb482b..00000000
--- a/jvm-runner/src/java/codewars/java/TempDir.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package codewars.java;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.*;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.nio.file.attribute.FileAttribute;
-import java.nio.file.attribute.PosixFilePermission;
-import java.nio.file.attribute.PosixFilePermissions;
-import java.util.Set;
-
-import static java.nio.file.Files.createTempDirectory;
-
-public class TempDir {
-
- private static void delete(Path path) throws IOException {
- if (!Files.exists(path)) return;
-
- Files.walkFileTree(path, new SimpleFileVisitor() {
- @Override
- public FileVisitResult postVisitDirectory(Path dir, IOException exc)
- throws IOException {
- Files.deleteIfExists(dir);
- return super.postVisitDirectory(dir, exc);
- }
-
- @Override
- public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
- throws IOException {
- Files.deleteIfExists(file);
- return super.visitFile(file, attrs);
- }
- });
- }
-
- private static FileAttribute> posixPermissions(String permissions) {
- Set perms = PosixFilePermissions.fromString(permissions);
- return PosixFilePermissions.asFileAttribute(perms);
- }
-
- private static void deleteOnShutdown(final Path path) {
- Runtime.getRuntime().addShutdownHook(new Thread() {
- @Override
- public void run() {
- try {
- delete(path);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- });
- }
-
- public static File create(String dir, String prefix, String permissions) throws IOException {
- final Path tempDirPath = createTempDirectory(Paths.get(dir), prefix, posixPermissions(permissions));
- deleteOnShutdown(tempDirPath);
- return tempDirPath.toFile();
- }
-
- public static File create(String prefix, String permissions) throws IOException {
- final Path tempDirPath = createTempDirectory(prefix, posixPermissions(permissions));
- deleteOnShutdown(tempDirPath);
- return tempDirPath.toFile();
- }
-
- // TODO: If permissions are not specified, use umask to get system defaults somehow
- public static File create(String prefix) throws IOException {
- return create(prefix, "rwx------");
- }
-
-}
diff --git a/jvm-runner/test/codewars/runners/clojure_test.clj b/jvm-runner/test/codewars/runners/clojure_test.clj
index aa8fd746..8ed727e8 100644
--- a/jvm-runner/test/codewars/runners/clojure_test.clj
+++ b/jvm-runner/test/codewars/runners/clojure_test.clj
@@ -1,27 +1,27 @@
(ns codewars.runners.clojure-test
(:require [clojure.test :refer :all]
[codewars.core :refer [-main] :as core]
- [codewars.test.utils :refer [with-out-str-not-thread-safe]]
+ [codewars.utils :refer [with-out-str-not-thread-safe]]
[cheshire.core :as json]
[codewars.clojure.test])
(:import [java.util.concurrent TimeoutException]))
(deftest basic-clojure
- (testing "-main can handle a very basic clojure solution and fixture"
+ (testing "-main can handle a very basic clojure code and fixture"
(with-in-str
(json/generate-string
{:language "clojure"
- :solution "(ns foo)"
+ :code "(ns foo)"
:fixture "(ns bar)"})
(is (= {:type :summary, :fail 0, :error 0, :pass 0, :test 0}
(-main))))))
(deftest clojure-simple
- (testing "-main can handle a simple clojure solution and fixture"
+ (testing "-main can handle a simple clojure code and fixture"
(with-in-str
(json/generate-string
{:language "clojure"
- :solution "(ns foo1)
+ :code "(ns foo1)
(defn wizard [] :ok)"
:fixture "(ns bar1
(:require [foo1]
@@ -35,7 +35,7 @@
(with-in-str
(json/generate-string
{:language "clojure"
- :solution "(ns dio)
+ :code "(ns dio)
(defn holy-diver [] :ride-the-tiger)"
:fixture "(ns race.for.the.morning
(:require [dio]
@@ -47,32 +47,32 @@
[codewars.clojure.test/fail (constantly nil)]
(-main)))))))
-(deftest clojure-solution-only
- (testing "-main will just run solution code if a fixture is not present"
+(deftest clojure-code-only
+ (testing "-main will just run code code if a fixture is not present"
(with-in-str
(json/generate-string
{:language "clojure"
- :solution "(print \"Oh no, here it comes again\")"})
+ :code "(print \"Oh no, here it comes again\")"})
(is (= "Oh no, here it comes again"
(with-out-str-not-thread-safe (-main)))))))
-(deftest clojure-solution-and-setup
- (testing "-main will just run solution code and read correctly from setup code"
+(deftest clojure-code-and-setup
+ (testing "-main will just run code code and read correctly from setup code"
(with-in-str
(json/generate-string
{:language "clojure"
:setup "(ns heaven.and.hell) (defn first-track [] (print \"So it's on and on and on, oh it's on and on and on\"))"
- :solution "(require 'heaven.and.hell) (heaven.and.hell/first-track)"})
+ :code "(require 'heaven.and.hell) (heaven.and.hell/first-track)"})
(is (= "So it's on and on and on, oh it's on and on and on"
(with-out-str-not-thread-safe (-main)))))))
-(deftest clojure-solution-fixture-and-setup
- (testing "-main can handle a solution, fixture, and setup code in clojure"
+(deftest clojure-code-fixture-and-setup
+ (testing "-main can handle a code, fixture, and setup code in clojure"
(with-in-str
(json/generate-string
{:language "clojure"
:setup "(ns fear.of.the.dark) (defn lyric [] \"I have a constant fear that someone's always near'\")"
- :solution "(ns maiden-greatest-hits (:require [fear.of.the.dark :refer [lyric]])) (defn fear-of-the-dark [] (lyric))"
+ :code "(ns maiden-greatest-hits (:require [fear.of.the.dark :refer [lyric]])) (defn fear-of-the-dark [] (lyric))"
:fixture "(ns maiden-test (:require
[maiden-greatest-hits]
[fear.of.the.dark :refer [lyric]]
@@ -82,11 +82,12 @@
(-main))))))
(deftest clojure-timeout
- (testing "-main will timeout if a kata solution takes too long"
+ (testing "-main will timeout if a kata code takes too long"
(with-in-str
(json/generate-string
{:language "clojure"
- :solution "(println \"...Sleeping deeply...\")
+ :code "(println \"...Sleeping deeply...\")
(Thread/sleep 50000)"})
- (with-redefs [core/fail #(throw %)]
+ (with-redefs [core/timeout 10
+ core/fail #(throw %)]
(is (thrown? TimeoutException (-main)))))))
diff --git a/jvm-runner/test/codewars/runners/groovy_test.clj b/jvm-runner/test/codewars/runners/groovy_test.clj
index 8c48512c..aad487fd 100644
--- a/jvm-runner/test/codewars/runners/groovy_test.clj
+++ b/jvm-runner/test/codewars/runners/groovy_test.clj
@@ -2,20 +2,20 @@
(:require [clojure.test :refer :all]
[cheshire.core :as json]
[codewars.core :refer [-main] :as core]
- [codewars.test.utils :refer [with-java-out-str]]))
+ [codewars.utils :refer [with-java-out-str]]))
-(deftest groovy-solution-only
- (testing "-main can handle a groovy solution with no fixture"
+(deftest groovy-code-only
+ (testing "-main can handle a groovy code with no fixture"
(with-in-str
(json/generate-string
{:language "groovy"
- :solution "1 + 1"})
+ :code "1 + 1"})
(is (= 2 (-main))))))
(deftest groovy-java-out
- (testing "-main can handle a groovy solution with no setup code but no fixture"
+ (testing "-main can handle a groovy code with no setup code but no fixture"
(with-in-str
(json/generate-string
{:language "groovy"
- :solution "print 'Hello Groovy!'"})
+ :code "print 'Hello Groovy!'"})
(is (= "Hello Groovy!" (with-java-out-str (-main)))))))
diff --git a/jvm-runner/test/codewars/runners/java_test.clj b/jvm-runner/test/codewars/runners/java_test.clj
index cd679881..54962939 100644
--- a/jvm-runner/test/codewars/runners/java_test.clj
+++ b/jvm-runner/test/codewars/runners/java_test.clj
@@ -1,45 +1,50 @@
(ns codewars.runners.java-test
(:require [clojure.test :refer :all]
[codewars.core :refer [-main] :as core]
- [codewars.test.utils :refer :all]
+ [codewars.utils :refer :all]
[cheshire.core :as json]))
-
(deftest java-basic
- (testing "-main can handle a very basic java solution and fixture"
+ (testing "-main can handle a very basic java code and fixture"
(with-in-str
(json/generate-string
{:language "java"
- :solution "class Foo {}"
+ :code "class Foo {}"
:fixture "class Bar {}"})
(is (= org.junit.runner.Result (class (-main)))))))
-(deftest java-solution-only
- (testing "-main can handle a java solution without a fixture"
+(deftest java-code-only
+ (testing "-main can handle a java code without a fixture"
(with-in-str
(json/generate-string
{:language "java"
- :solution "class FooFighters { static int main(String [] args) {return 1;} }"})
- (is (= 1 (-main))))))
+ :code "class FooFighters { static int main(String [] args) {return 1;} }"})
+ (is (= 1 (-main))))
+ (with-in-str
+ (json/generate-string
+ {:language "java"
+ :code "package bar.baz ; class FooFighters { static int main(String [] args) {return 7;} }"})
+ (is (= 7 (-main))))))
-(deftest java-solution-print
- (testing "-main can handle a java solution that prints to standard out"
+
+(deftest java-code-print
+ (testing "-main can handle a java code that prints to standard out"
(with-in-str
(json/generate-string
{:language "java"
- :solution "public class Hello {public static void main(String[] args) {System.out.print(\"Hellooo!\");}}"})
+ :code "public class Hello {public static void main(String[] args) {System.out.print(\"Hellooo!\");}}"})
(is (= "Hellooo!" (with-java-out-str (-main)))))))
(deftest java-setup-code
- (testing "-main can handle a java solution and setup code"
+ (testing "-main can handle a java code and setup code"
(with-in-str
(json/generate-string
{:language "java"
:setup "import java.lang.String;
public class Beatles {public static String sayHello() {
return \"Hello, hello!\";}}"
- :solution "class HelloAgain {
+ :code "class HelloAgain {
static void main(String[] args) {
System.out.print(Beatles.sayHello());}}"})
(is (= "Hello, hello!" (with-java-out-str (-main)))))))
@@ -49,8 +54,8 @@
(with-in-str
(json/generate-string
{:language "java"
- :solution "public class Solution {
- public Solution(){}
+ :code "public class Code {
+ public Code(){}
public int testthing(){return 3;}}",
:fixture "import static org.junit.Assert.assertEquals;
import org.junit.Test;
@@ -58,7 +63,7 @@
public class TestFixture {
public TestFixture(){}
@Test public void myTestFunction(){
- Solution s = new Solution();
+ Code s = new Code();
assertEquals(\"wow\", 3, s.testthing());
System.out.println(\"test out\");}}"})
(let [test-out-string (with-java-out-str (-main))]
@@ -71,7 +76,7 @@
(with-in-str
(json/generate-string
{:language "java"
- :solution "public class Foo {
+ :code "public class Foo {
public Foo(){}
public int testthing(){return 3;}
public static void main(String[] args){System.out.println(\"42\");}}"
@@ -96,7 +101,7 @@
(with-in-str
(json/generate-string
{:language "java"
- :solution "public class Solution {
+ :code "public class Code {
public static void main(String[] args){
notdefinedgonnafail(\"42\");}}"})
(let [error-message
@@ -104,16 +109,16 @@
(is (.contains error-message "error: cannot find symbol"))
(is (.contains error-message "notdefinedgonnafail(\"42\");"))
(is (.contains error-message "symbol: method notdefinedgonnafail(String)"))
- (is (.contains error-message "location: class Solution"))
+ (is (.contains error-message "location: class Code"))
(is (.contains error-message "1 error"))))))
(deftest java-nine-yards
- (testing "-main can setup, solution, and test fixture code for java"
+ (testing "-main can setup, code, and test fixture code for java"
(with-in-str
(json/generate-string
{:language "java"
:setup "public class Setupp { public static int three() {return 3;}}"
- :solution "public class Sollution {
+ :code "public class Sollution {
public Sollution(){}
public int testthingy(){return Setupp.three();}}",
:fixture "import static org.junit.Assert.assertEquals;
@@ -121,21 +126,22 @@
import org.junit.runners.JUnit4;
public class NineYards {
public NineYards(){}
- @Test public void solutionAndSetupAndFixture(){
+ @Test public void codeAndSetupAndFixture(){
Sollution s = new Sollution();
assertEquals(\"wow\", 3, s.testthingy());
System.out.println(\"test out\");}}"})
(let [test-out-string (with-java-out-str (-main))]
- (is (.contains test-out-string "solutionAndSetupAndFixture(NineYards)<:LF:>"))
+ (is (.contains test-out-string "codeAndSetupAndFixture(NineYards)<:LF:>"))
(is (.contains test-out-string "test out"))
(is (.contains test-out-string "Test Passed<:LF:>"))))))
+
(deftest codewars-kumite-test
(testing "Can handle a simple static export"
(with-in-str
(json/generate-string
{:language "java"
- :solution "public class Java {
+ :code "public class Java {
public static int multiply(int x, int y) { return x * y; } }"
:fixture "import org.junit.*;
diff --git a/jvm-runner/test/codewars/warm_up_test.clj b/jvm-runner/test/codewars/warm_up_test.clj
new file mode 100644
index 00000000..1195be2e
--- /dev/null
+++ b/jvm-runner/test/codewars/warm_up_test.clj
@@ -0,0 +1,17 @@
+(ns codewars.warm-up-test
+ (:require [clojure.test :refer :all]
+ [codewars.warm-up :refer :all]))
+
+(deftest warm-up-test
+ (testing "java-code-warm-up should return 7 every time"
+ (is (= 7 (java-code-warm-up))))
+ (testing "clojure-code-warm-up should return :warm-up-payload every time"
+ (is (= :warm-up-payload (clojure-code-warm-up))))
+ (testing "clojure-test-warm-up should pass"
+ (let [result (clojure-test-warm-up)]
+ (is (.contains result "PASSED"))
+ (is (.contains result ":in-test-payload-test"))))
+ (testing "java-test-warm-up should pass"
+ (let [result (java-test-warm-up)]
+ (is (.contains result "PASSED")
+ (.contains result "codeAndSetupAndFixture")))))
diff --git a/lib/config.js b/lib/config.js
new file mode 100644
index 00000000..a4b211bf
--- /dev/null
+++ b/lib/config.js
@@ -0,0 +1,94 @@
+var uniqueId = ('_' + Math.random()).replace(/[^_\d]/g, '');
+
+module.exports = {
+ version: '1.0.5',
+ testFramework: {
+ defaults: {
+ javascript: 'cw-2',
+ coffeescript: 'cw-2',
+ ruby: 'cw-2',
+ python: 'cw-2'
+ }
+ },
+ timeouts: {
+ default: 6000,
+ clojure: 10000,
+ java: 10000
+ },
+ moduleRegExs: {
+ haskell: /module\s+([A-Z]([a-z|A-Z|0-9]|\.[A-Z])*)\W/,
+ julia: /module\s+([a-z|A-Z][a-z|A-Z|0-9]*)\W/,
+ erlang: /-module\(([a-z|A-Z][a-z|A-Z|0-9|_]*)\)/,
+ scala: /(?:object|class)\s+([A-Z][a-z|A-Z|0-9|_]*)/,
+ swift: /\n*\/\/\s*([a-z|A-Z|0-9|_|-]+)\.swift\s*\n/,
+ objc: /\n*\/\/\s*([a-z|A-Z|0-9|_|-]+)\.m\s*\n/,
+ objcHeader: /\n*\/\/\s*([a-z|A-Z|0-9|_|-]+)\.h\s*\n/
+ },
+ fileExtensions: {
+ haskell: 'hs',
+ julia: 'jl',
+ erlang: 'erl',
+ scala: 'scala',
+ swift: 'swift',
+ objc: 'm',
+ objcHeader: 'h'
+ },
+ snippets: {
+ javascript: {
+ requireCw2: "require('./frameworks/javascript/cw-2')\n",
+ start: "Test.handleError(function(){\n",
+ inlineTestFixture: {
+ start: "\n(function() { var Test = global.Test, describe = global.describe, it = global.it, before = global.before, after = global.after;",
+ end: '\n})();'
+ },
+ closure: {
+ start: "\n(function() { \n",
+ end: '\n})();'
+ },
+ end: "});"
+ },
+ python: {
+ addPythonFramework: [
+ "try: from imp import reload",
+ "except: pass",
+ "reload(__import__('sys')).path.append('./frameworks/python')"
+ ].join('\n'),
+ requireCw2: "test = Test = reload(__import__('cw-2'))",
+ requireUnittest: "unittest = reload(__import__('unittest'))",
+ runUnittest: [
+ "unittest",
+ ".TestLoader()",
+ ".loadTestsFromTestCase(Test)",
+ ".run(reload(__import__('unittestwrapper')).CwTestResult())"
+ ].join('')
+ },
+ php: {
+ bootstrap: [
+ "require_once('frameworks/php/vendor/autoload.php');"
+ ].join('\n'),
+ beforeUserScript : [
+ "$" + uniqueId + " = count(get_defined_vars());" // http://stackoverflow.com/a/13629024/1640765
+ ].join('\n'),
+ afterUserScript: [
+ "$_" + uniqueId + " = array_slice(get_defined_vars(), $" + uniqueId + " + 1);",
+ ].join('\n'),
+ classBegin: [
+ "class KataTest extends CodeWars\\TestCase {",
+ "public function testSolution() {",
+ "extract($this->userScriptVariables);"
+ ].join('\n'),
+ classEnd : [
+ "}",
+ "}"
+ ].join('\n'),
+ execute: [
+ "$suite = new PHPUnit_Framework_TestSuite();",
+ "$test = new KataTest('testSolution', ['userScriptVariables' => $_" + uniqueId + "]);",
+ "$suite->addTest($test);",
+ "PHPUnit_TextUI_TestRunner::run($suite);"
+ ].join('\n')
+ }
+ }
+};
+
+module.exports.snippets.python3 = module.exports.snippets.python;
diff --git a/lib/runner.js b/lib/runner.js
new file mode 100644
index 00000000..68b56af2
--- /dev/null
+++ b/lib/runner.js
@@ -0,0 +1,6 @@
+// runs the code, supports both callback and Promise formats
+module.exports.run = function (opts, cb) {
+ // opts.code is an alias for opts.solution
+ if(opts.code) opts.solution = opts.code;
+ return require("./runners/" + opts.language).run(opts, cb);
+};
diff --git a/lib/runners/README.md b/lib/runners/README.md
new file mode 100644
index 00000000..cbc3d6ad
--- /dev/null
+++ b/lib/runners/README.md
@@ -0,0 +1,10 @@
+# Runners
+This directory contains language specific "runners". Each runner has two strategies in which it can be called in.
+
+## Strategies
+
+### solutionOnly
+In this strategy, the code is simply executed and the output is returned. There is no test suite integration.
+
+### fullProject
+In this strategy, the code is executed within a test suite and the test output is returned.
diff --git a/lib/runners/arm.js b/lib/runners/arm.js
new file mode 100644
index 00000000..28bfdb4d
--- /dev/null
+++ b/lib/runners/arm.js
@@ -0,0 +1,29 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ path = require('path'),
+ temp = require('temp');
+
+module.exports.run = function run(opts, cb) {
+ temp.track();
+ var dir = temp.mkdirSync('arm');
+
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ var executable = path.join(dir, 'solution'),
+ solutionFile = util.codeWriteSync('arm', opts.solution + '\n', dir, 'solution.s'),
+ objectFile = solutionFile.replace(/\.[^\.]+$/, '.o'),
+ armCommand = ['arm-linux-gnueabi-as', solutionFile, '-o', objectFile].join(' '),
+ // Check for whether we need to link against libc
+ linker = opts.solution.search(/\.glob[a]?l\W+_start/) == -1 ? "arm-linux-gnueabi-gcc-4.7" : "arm-linux-gnueabi-ld",
+ linkerCommand = [linker, objectFile, '-o', executable].join(' ');
+ util.exec(armCommand, function () {
+ util.exec(linkerCommand, function () {
+ run({'name': 'qemu-arm', 'args': ['-L', '/usr/arm-linux-gnueabi/', executable]});
+ });
+ });
+ },
+ fullProject: function (run) {
+ throw new Error('Test framework is not supported');
+ }
+ });
+};
diff --git a/lib/runners/bash.js b/lib/runners/bash.js
new file mode 100644
index 00000000..398b32c1
--- /dev/null
+++ b/lib/runners/bash.js
@@ -0,0 +1,22 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ config = require('../config'),
+ temp = require('temp');
+
+module.exports.run = function run(opts, cb)
+{
+ temp.track();
+ var dir = temp.mkdirSync('bash');
+
+ shovel.start(opts, cb, {
+ solutionOnly: function (run)
+ {
+ var file = util.codeWriteSync('bash', opts.solution, dir, 'solution.sh')
+ run({name: 'bash', 'args': [file]});
+ },
+ fullProject: function (run)
+ {
+ throw 'Test framework is not supported'
+ }
+ });
+};
\ No newline at end of file
diff --git a/lib/runners/c.js b/lib/runners/c.js
new file mode 100644
index 00000000..e3496471
--- /dev/null
+++ b/lib/runners/c.js
@@ -0,0 +1,25 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ path = require('path'),
+ temp = require('temp');
+
+module.exports.run = function run(opts, cb) {
+ temp.track();
+ var dir = temp.mkdirSync('c');
+
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ var executable = path.join(dir, 'solution'),
+ solutionFile = util.codeWriteSync('c', opts.solution, dir, 'solution.c'),
+ args = ['tcc', '-o', executable, solutionFile];
+ if (opts.setup) {
+ var setupFile = util.codeWriteSync('c', opts.setup, dir, 'setup.c');
+ args.push(setupFile);
+ }
+ util.exec(args.join(' '), function () { run({'name': executable, 'args': []}); });
+ },
+ fullProject: function (run) {
+ throw Exception("C is not supported");
+ }
+ });
+};
diff --git a/lib/runners/clojure.js b/lib/runners/clojure.js
new file mode 100644
index 00000000..564e6049
--- /dev/null
+++ b/lib/runners/clojure.js
@@ -0,0 +1,22 @@
+var shovel = require('../shovel'),
+ path = require('path');
+
+module.exports.run = function run(opts, cb) {
+ var uberJar = path.resolve(__dirname, '../../jvm-runner/target/jvm-runner-0.1.1-standalone.jar');
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ run({
+ name: 'java',
+ args: ['-jar', uberJar],
+ stdin: JSON.stringify(opts)
+ });
+ },
+ fullProject: function (run) {
+ return run({
+ name: 'java',
+ args: ['-jar', uberJar],
+ stdin: JSON.stringify(opts)
+ });
+ }
+ });
+};
diff --git a/lib/runners/coffeescript.js b/lib/runners/coffeescript.js
new file mode 100644
index 00000000..60e74a6b
--- /dev/null
+++ b/lib/runners/coffeescript.js
@@ -0,0 +1,43 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ config = require('../config');
+
+module.exports.run = function run(opts, cb) {
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ var code = opts.solution;
+
+ if (opts.setup) {
+ code = opts.setup + ';\n' + code;
+ }
+
+ run({name: 'coffee', 'args': ['-e', code]});
+ },
+ fullProject: function (run) {
+ switch (opts.testFramework) {
+ case 'cw-2':
+ return prepareCw2(opts, run);
+
+ default:
+ throw 'Test framework is not supported'
+ }
+ }
+ });
+};
+
+function prepareCw2(opts, run) {
+
+ var code = config.snippets.javascript.requireCw2;
+ code += "`\n" + config.snippets.javascript.start + "`\n";
+ if (opts.setup) {
+ code += opts.setup + '\n';
+ }
+
+ code += opts.solution + '\n';
+ code += '`\n' + config.snippets.javascript.inlineTestFixture.start + '`\n';
+ code += opts.fixture;
+ code += '\n`' + config.snippets.javascript.inlineTestFixture.end + '\n';
+ code += config.snippets.javascript.end + "`";
+
+ run({name: 'coffee', 'args': ['-e', code]});
+}
\ No newline at end of file
diff --git a/lib/runners/cpp.js b/lib/runners/cpp.js
new file mode 100644
index 00000000..141743d5
--- /dev/null
+++ b/lib/runners/cpp.js
@@ -0,0 +1,36 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ path = require('path'),
+ temp = require('temp'),
+ exec = require('child_process').exec;
+
+function compile(args, cb) {
+ args.unshift('clang++', '-std=c++11');
+ exec(args.join(' '), cb);
+}
+
+module.exports.run = function run(opts, cb) {
+ temp.track();
+ var dir = temp.mkdirSync('cpp');
+
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ var executable = path.join(dir, 'solution'),
+ solutionFile = util.codeWriteSync('c++', opts.solution, dir, 'solution.cpp'),
+ args = [solutionFile, '-o', executable];
+ if (opts.setup) {
+ var setupFile = util.codeWriteSync('cpp', opts.setup, dir, 'setup.cpp');
+ args.unshift(setupFile);
+ }
+ compile(args, function (error, stdout, stderr) {
+ if (stdout) console.log(stdout);
+ if (stderr) throw new Error(stderr);
+ if (error !== null) throw error;
+ run({'name': executable, 'args': []});
+ });
+ },
+ fullProject: function (run) {
+ throw new Error('Test framework is not supported');
+ }
+ });
+};
diff --git a/lib/runners/csharp.js b/lib/runners/csharp.js
new file mode 100644
index 00000000..d171f078
--- /dev/null
+++ b/lib/runners/csharp.js
@@ -0,0 +1,64 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ temp = require('temp').track(),
+ path = require('path'),
+ nunitAssemblies = ['nunit.core.dll', 'nunit.core.interfaces.dll', 'nunit.util.dll', 'nunit.framework.dll'].join(','),
+ nunitPath = path.resolve(__dirname, '..', '..', 'frameworks', 'csharp', 'nunit');
+
+module.exports.run = function run(opts, cb) {
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ var dir = temp.mkdirSync('csharp'),
+ codeFile = util.codeWriteSync('csharp', opts.solution, dir, 'code.cs'),
+ exe = path.join(dir, 'solution.exe'),
+ args = ['mcs', '-out:' + exe, codeFile];
+
+ if (opts.setup) {
+ args.push(util.codeWriteSync('csharp', opts.solution, dir, 'setup.cs'));
+ }
+ util.exec(args.join(' '), function (error) {
+ if (error && error != '') return run(error.toString());
+ run({'name': 'mono', 'args': [exe]});
+ });
+ },
+ fullProject: function (run) {
+ var dir = temp.mkdirSync('csharp'),
+ fixtureFile = util.codeWriteSync('csharp', opts.fixture, dir, 'fixture.cs'),
+ codeFile = util.codeWriteSync('csharp', opts.solution, dir, 'code.cs'),
+ testDLL = path.join(dir, 'test.dll'),
+ args = [
+ 'mcs',
+ '-out:' + testDLL,
+ '-lib:' + nunitPath,
+ '-r:' + nunitAssemblies,
+ '-reference:System.Numerics.dll',
+ '-reference:System.Drawing.dll',
+ '-reference:System.Data.dll',
+ '-reference:System.Messaging.dll',
+ '-reference:System.Xml.dll',
+ '-target:library',
+ codeFile,
+ fixtureFile
+ ];
+
+ if (opts.setup) {
+ args.push(util.codeWriteSync('csharp', opts.setup, dir, 'setup.cs'));
+ }
+
+ util.exec(args.join(' '), function (error) {
+ if (error && error != '') return run(error.toString());
+ run({
+ name: "mono",
+ args: [
+ path.join(nunitPath, 'nunit-console.exe'),
+ '-nologo',
+ '-noresult',
+ testDLL
+ ],
+ options: {env: process.env}
+ });
+ });
+ }
+ });
+};
+
diff --git a/lib/runners/elixir.js b/lib/runners/elixir.js
new file mode 100644
index 00000000..655c624d
--- /dev/null
+++ b/lib/runners/elixir.js
@@ -0,0 +1,18 @@
+var shovel = require('../shovel');
+
+module.exports.run = function run(opts, cb) {
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ if (opts.setup) {
+ opts.solution = opts.setup + opts.solution;
+ }
+ run({
+ name: 'elixir',
+ args: ['-e', opts.solution]
+ });
+ },
+ fullProject: function (run) {
+ throw new Error('Test framework is not supported');
+ }
+ });
+};
\ No newline at end of file
diff --git a/lib/runners/erlang.js b/lib/runners/erlang.js
new file mode 100644
index 00000000..275ba331
--- /dev/null
+++ b/lib/runners/erlang.js
@@ -0,0 +1,66 @@
+var shovel = require('../shovel'),
+ config = require('../config'),
+ codeWriteSync = require('../util').codeWriteSync,
+ fs = require('fs'),
+ path = require('path'),
+ temp = require('temp');
+
+function moduleName(fileName) {
+ return path.basename(fileName).replace(/\.[^/.]+$/, "");
+}
+
+function erlangCompileCommand(fileName, erlangCodeDir) {
+ return [
+ 'compile:file("',
+ fileName,
+ '", {outdir,"', erlangCodeDir ,'"}),'
+ ].join('');
+}
+
+function compileFileSync(code,erlangCodeDir) {
+ return erlangCompileCommand( codeWriteSync('erlang', code, erlangCodeDir), erlangCodeDir);
+}
+
+module.exports.run = function(opts, cb) {
+ temp.track();
+ var erlangCodeDir = temp.mkdirSync('erlang');
+ shovel.start(opts, cb, {
+ solutionOnly: function (exec) {
+ var setup = opts.setup ? compileFileSync(opts.setup, erlangCodeDir) : '';
+ exec({
+ name: 'erl',
+ args: ['-pz', erlangCodeDir, '-noshell', '-eval', [setup, opts.solution].join('')],
+ options: { env: {
+ HOME: process.env['HOME'],
+ ERL_CRASH_DUMP: "/dev/null"
+ }}
+ });
+ },
+ fullProject: function (exec) {
+ var setup = opts.setup ? compileFileSync(opts.setup, erlangCodeDir) : '',
+ solutionFileName = codeWriteSync('erlang', opts.solution, erlangCodeDir),
+ solutionModuleName = moduleName(solutionFileName),
+ testFixture = compileFileSync([
+ '-module(' + solutionModuleName + '_tests).',
+ '-compile(export_all).',
+ '-include_lib("eunit/include/eunit.hrl").',
+ opts.fixture
+ ].join('\n'), erlangCodeDir);
+
+ exec({
+ name: 'erl',
+ args: ['-pz', erlangCodeDir, '-noshell', '-eval',
+ [
+ setup,
+ erlangCompileCommand(solutionFileName, erlangCodeDir),
+ testFixture,
+ 'eunit:test(', solutionModuleName, '), init:stop().'
+ ].join('')],
+ options: { env: {
+ HOME: process.env['HOME'],
+ ERL_CRASH_DUMP: "/dev/null"
+ }}
+ });
+ }
+ });
+};
\ No newline at end of file
diff --git a/lib/runners/fsharp.js b/lib/runners/fsharp.js
new file mode 100644
index 00000000..6ff77352
--- /dev/null
+++ b/lib/runners/fsharp.js
@@ -0,0 +1,28 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ config = require('../config'),
+ temp = require('temp');
+
+module.exports.run = function(opts, cb)
+{
+ temp.track();
+ var dir = temp.mkdirSync('fsharp');
+
+ shovel.start(opts, cb, {
+ solutionOnly: function (run)
+ {
+ var file = util.codeWriteSync('fsharp', opts.solution, dir, 'solution.fsx');
+ run({name: 'fsharpi', 'args': [file]});
+ },
+ fullProject: function (run)
+ {
+ throw 'Test framework is not supported'
+ }
+ });
+};
+
+
+
+
+
+
diff --git a/lib/runners/gas.js b/lib/runners/gas.js
new file mode 100644
index 00000000..48112e44
--- /dev/null
+++ b/lib/runners/gas.js
@@ -0,0 +1,29 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ path = require('path'),
+ temp = require('temp');
+
+module.exports.run = function(opts, cb) {
+ temp.track();
+ var dir = temp.mkdirSync('gas');
+
+ shovel.start(opts, cb, {
+ solutionOnly: function(run) {
+ var executable = path.join(dir, 'solution'),
+ solutionFile = util.codeWriteSync('gas', opts.solution + '\n', dir, 'solution.s'),
+ objectFile = solutionFile.replace(/\.[^\.]+$/, '.o'),
+ gasCommand = ['gcc', '-c', solutionFile, '-o', objectFile].join(' '),
+ // Check for whether we need to link against libc
+ linker = opts.solution.search(/\.global\W+_start/) == -1 ? "gcc" : "ld";
+ linkerCommand = [linker, objectFile, '-o', executable].join(' ');
+ util.exec(gasCommand, function () {
+ util.exec(linkerCommand, function () {
+ run({'name': executable, 'args': []});
+ });
+ });
+ },
+ fullProject: function (run) {
+ throw new Error('Test framework is not supported');
+ }
+ });
+};
diff --git a/lib/runners/go.js b/lib/runners/go.js
new file mode 100644
index 00000000..9b2751a6
--- /dev/null
+++ b/lib/runners/go.js
@@ -0,0 +1,21 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ temp = require('temp');
+
+module.exports.run = function run(opts, cb)
+{
+ temp.track();
+ var dir = temp.mkdirSync('go');
+
+ shovel.start(opts, cb, {
+ solutionOnly: function (run)
+ {
+ var file = util.codeWriteSync('go', opts.solution, dir, 'solution.go')
+ run({name: 'go', 'args': ['run', file]});
+ },
+ fullProject: function ()
+ {
+ throw 'Test framework is not supported'
+ }
+ });
+};
\ No newline at end of file
diff --git a/lib/runners/groovy.js b/lib/runners/groovy.js
new file mode 100644
index 00000000..8aa92985
--- /dev/null
+++ b/lib/runners/groovy.js
@@ -0,0 +1,22 @@
+var shovel = require('../shovel'),
+ path = require('path');
+
+module.exports.run = function run(opts, cb) {
+ var uberJar = path.resolve(__dirname, '../../jvm-runner/target/jvm-runner-0.1.1-standalone.jar');
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ run({
+ name: 'java',
+ args: ['-jar', uberJar],
+ stdin: JSON.stringify(opts)
+ });
+ },
+ fullProject: function (run) {
+ run({
+ name: 'java',
+ args: ['-jar', uberJar],
+ stdin: JSON.stringify(opts)
+ });
+ }
+ });
+};
diff --git a/lib/runners/haskell.js b/lib/runners/haskell.js
new file mode 100644
index 00000000..40647093
--- /dev/null
+++ b/lib/runners/haskell.js
@@ -0,0 +1,36 @@
+var shovel = require('../shovel'),
+ config = require('../config'),
+ codeWriteSync = require('../util').codeWriteSync,
+ fs = require('fs'),
+ temp = require('temp');
+
+module.exports.run = function run(opts, cb) {
+ temp.track();
+ var haskellCodeDir = temp.mkdirSync('haskell');
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ if (opts.setup) codeWriteSync('haskell', opts.setup, haskellCodeDir);
+ run({
+ name: 'runhaskell',
+ args: [
+ '-i' + ['frameworks/haskell', haskellCodeDir].join(':'),
+ codeWriteSync('haskell', opts.solution, haskellCodeDir, "Main.hs")
+ ]
+ });
+ },
+ fullProject: function (run) {
+ if (opts.setup) codeWriteSync('haskell', opts.setup, haskellCodeDir);
+ var solutionFileName = codeWriteSync('haskell', opts.solution, haskellCodeDir, "Main.hs"),
+ fixtureFileName = solutionFileName.split('/').pop() == "Main.hs" ?
+ codeWriteSync('haskell', opts.fixture, haskellCodeDir) :
+ codeWriteSync('haskell', opts.fixture, haskellCodeDir, "Main.hs");
+ process.env["solutionFileName"] = solutionFileName;
+
+ run({
+ name: 'runhaskell',
+ args: ['-i' + ['frameworks/haskell', haskellCodeDir].join(':'), fixtureFileName],
+ options: { env: process.env }
+ });
+ }
+ });
+};
diff --git a/lib/runners/java.js b/lib/runners/java.js
new file mode 100644
index 00000000..8aa92985
--- /dev/null
+++ b/lib/runners/java.js
@@ -0,0 +1,22 @@
+var shovel = require('../shovel'),
+ path = require('path');
+
+module.exports.run = function run(opts, cb) {
+ var uberJar = path.resolve(__dirname, '../../jvm-runner/target/jvm-runner-0.1.1-standalone.jar');
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ run({
+ name: 'java',
+ args: ['-jar', uberJar],
+ stdin: JSON.stringify(opts)
+ });
+ },
+ fullProject: function (run) {
+ run({
+ name: 'java',
+ args: ['-jar', uberJar],
+ stdin: JSON.stringify(opts)
+ });
+ }
+ });
+};
diff --git a/lib/runners/javascript.js b/lib/runners/javascript.js
new file mode 100644
index 00000000..bfc33dbd
--- /dev/null
+++ b/lib/runners/javascript.js
@@ -0,0 +1,145 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ config = require('../config'),
+ temp = require('temp'),
+ child_process = require('child_process');
+
+module.exports.run = function run(opts, cb)
+{
+ shovel.start(opts, cb, {
+ solutionOnly: function (run)
+ {
+ var code = opts.solution;
+
+ if (opts.setup)
+ code = opts.setup + ';\n' + code;
+
+ run({name: 'node', 'args': ['-e', transform(code)]});
+ },
+ fullProject: function (run)
+ {
+ switch (opts.testFramework)
+ {
+ case 'cw-2':
+ return prepareCw2(opts, run);
+
+ case 'mocha':
+ case 'mocha_bdd':
+ return prepareMocha(opts, 'bdd', run);
+
+ case 'mocha_tdd':
+ return prepareMocha(opts, 'tdd', run);
+
+ default:
+ throw 'Test framework is not supported'
+ }
+ },
+ sanitizeStdErr: function(error)
+ {
+ error = error || ''
+ return error.replace(/(\()?\/codewars\/[(\w\/-\d.js:) ;]*/g, '')
+ .replace(/( Object. )?[\(]?\[eval\][-:\w\d\)]* at/g, '')
+ .replace(/Module._compile.*/g, '')
+ .replace('Object.Test.handleError ', '')
+ .replace(' ', ' ');
+ },
+ sanitizeStdOut: function(stdout)
+ {
+ return this.sanitizeStdErr(stdout);
+ }
+ });
+};
+
+function prepareMocha(opts, interfaceType, run) {
+ var dir = temp.mkdirSync('javascript');
+ var code = '';
+
+ if (opts.setup)
+ {
+ code = opts.setup + ';\n';
+ }
+
+ code += opts.solution + ';\n';
+
+ // run tests inline to the context but within their own scope. Redefine the key test methods in case they were
+ // locally redefined within the solution.
+
+ // TODO: instead of using one file, we should require the solution file into the spec file (see TypeScript implementation)
+ code += config.snippets.javascript.closure.start;
+ code += opts.fixture;
+ code += config.snippets.javascript.closure.end;
+
+ var solutionFile = util.codeWriteSync('javascript', transform(code), dir, 'mocha', true);
+ run({name: 'mocha', 'args': ['--harmony', '-u', interfaceType, '-R', 'mocha-reporter', solutionFile]});
+}
+
+function prepareCw2(opts, run)
+{
+ var code = config.snippets.javascript.requireCw2;
+ code += "var assert = require('assert');\n";
+
+ code += config.snippets.javascript.start;
+
+ if (opts.setup)
+ {
+ code += opts.setup + ';\n';
+ }
+
+ code += opts.solution + ';\n';
+
+ // run tests inline to the context but within their own scope. Redefine the key test methods in case they were
+ // locally redefined within the solution.
+ code += ';' + config.snippets.javascript.inlineTestFixture.start;
+ code += opts.fixture;
+ code += config.snippets.javascript.inlineTestFixture.end;
+ code += config.snippets.javascript.end;
+ run({name: 'node', 'args': ['-e', transform(code)]});
+}
+
+function transform(code) {
+ try {
+ return require('babel-core').transform(code, {
+ presets: ["stage-1", "react"],
+ plugins: [
+ "transform-runtime",
+ "check-es2015-constants",
+ "transform-es2015-arrow-functions",
+ "transform-es2015-block-scoped-functions",
+ "transform-es2015-block-scoping",
+ "transform-es2015-classes",
+ "transform-es2015-computed-properties",
+ "transform-es2015-destructuring",
+ "transform-es2015-duplicate-keys",
+ "transform-es2015-for-of",
+ "transform-es2015-function-name",
+ "transform-es2015-literals",
+ "transform-es2015-object-super",
+ "transform-es2015-parameters",
+ "transform-es2015-shorthand-properties",
+ "transform-es2015-spread",
+ "transform-es2015-sticky-regex",
+ "transform-es2015-template-literals",
+ "transform-es2015-typeof-symbol",
+ "transform-es2015-unicode-regex",
+ "transform-regenerator",
+ ],
+ ast: false,
+ filename: 'kata'
+ }).code;
+ }
+ catch(ex) {
+ var msg = ex.message;
+ if (ex.loc) {
+ // replace the line number since it is not what the user sees
+ msg = msg.replace(/ \(\d*:\d*\)/, ":" + ex.loc.column)
+ var lines = code.split('\n');
+ msg += "\n" + lines[ex.loc.line - 1];
+ msg += "\n";
+ for(var i = 1;i < ex.loc.column; i++) {
+ msg += ' ';
+ }
+ msg += '^';
+ }
+ throw new shovel.CompileError(msg);
+ }
+}
diff --git a/lib/runners/julia.js b/lib/runners/julia.js
new file mode 100644
index 00000000..42ae3955
--- /dev/null
+++ b/lib/runners/julia.js
@@ -0,0 +1,28 @@
+var shovel = require('../shovel'),
+ config = require('../config'),
+ codeWriteSync = require('../util').codeWriteSync,
+ fs = require('fs'),
+ temp = require('temp');
+
+module.exports.run = function run(opts, cb) {
+ temp.track();
+ var juliaCodeDir = temp.mkdirSync('julia');
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ if (opts.setup) codeWriteSync('julia', opts.setup, juliaCodeDir);
+ run({
+ name: 'julia',
+ args: ['-P', ['push!(LOAD_PATH, "', juliaCodeDir, '", "frameworks/julia")'].join(""),
+ '-e', opts.solution]
+ });
+ },
+ fullProject: function (run) {
+ codeWriteSync('julia', opts.solution, juliaCodeDir);
+ if (opts.setup) codeWriteSync('julia', opts.setup, juliaCodeDir);
+ run({
+ name: 'julia',
+ args: ['-P', ['push!(LOAD_PATH, "', juliaCodeDir , '", "frameworks/julia")'].join(""), '-e', opts.fixture]
+ });
+ }
+ });
+};
\ No newline at end of file
diff --git a/lib/runners/lisp.js b/lib/runners/lisp.js
new file mode 100644
index 00000000..f1b3573d
--- /dev/null
+++ b/lib/runners/lisp.js
@@ -0,0 +1,27 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ temp = require('temp');
+
+module.exports.run = function run(opts, cb) {
+ temp.track();
+ var lispCodeDir = temp.mkdirSync('lisp'),
+ args = [
+ '--noinform', // Disable banner
+ '--disable-ldb', // Disable the low-level debugger
+ '--lose-on-corruption', // Don't try to recover
+ '--non-interactive' // No REPL
+ ];
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ if (opts.setup) {
+ var setupFile = util.codeWriteSync('lisp', opts.setup, lispCodeDir, 'setup.lisp');
+ args.push('--load', setupFile);
+ }
+ args.push('--eval', opts.solution);
+ run({name: 'sbcl', args: args});
+ },
+ fullProject: function (run) {
+ throw 'Test framework is not supported';
+ }
+ });
+};
\ No newline at end of file
diff --git a/lib/runners/lua.js b/lib/runners/lua.js
new file mode 100644
index 00000000..10a0bddd
--- /dev/null
+++ b/lib/runners/lua.js
@@ -0,0 +1,28 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ config = require('../config'),
+ temp = require('temp');
+
+module.exports.run = function run(opts, cb)
+{
+ temp.track();
+ var dir = temp.mkdirSync('lua');
+
+ shovel.start(opts, cb, {
+ solutionOnly: function (run)
+ {
+ var file = util.codeWriteSync('lua', opts.solution, dir, 'solution.lua')
+ run({name: 'lua', 'args': [file]});
+ },
+ fullProject: function (run)
+ {
+ throw 'Test framework is not supported'
+ }
+ });
+};
+
+
+
+
+
+
diff --git a/lib/runners/nasm.js b/lib/runners/nasm.js
new file mode 100644
index 00000000..d0c2546b
--- /dev/null
+++ b/lib/runners/nasm.js
@@ -0,0 +1,30 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ path = require('path'),
+ temp = require('temp');
+
+module.exports.run = function run(opts, cb) {
+ temp.track();
+ var dir = temp.mkdirSync('nasm');
+
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ // TODO: Support setup code; setup code should either be NASM or C, and we should automatically detect it
+ var executable = path.join(dir, 'solution'),
+ solutionFile = util.codeWriteSync('nasm', opts.solution + '\n', dir, 'solution.asm'),
+ nasmCommand = ['nasm', '-felf64', solutionFile].join(' '),
+ objectFile = solutionFile.replace(/\.[^\.]+$/, '.o'),
+ // Check for whether we need to link against libc
+ linker = opts.solution.search(/global\W+_start/) == -1 ? "gcc" : "ld";
+ linkerCommand = [linker, objectFile, '-o', executable].join(' ');
+ util.exec(nasmCommand, function () {
+ util.exec(linkerCommand, function () {
+ run({'name': executable, 'args': []});
+ });
+ });
+ },
+ fullProject: function (run) {
+ throw new Error('Test framework is not supported');
+ }
+ });
+};
diff --git a/lib/runners/objc.js b/lib/runners/objc.js
new file mode 100644
index 00000000..fb4ddce2
--- /dev/null
+++ b/lib/runners/objc.js
@@ -0,0 +1,36 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ path = require('path'),
+ temp = require('temp');
+
+module.exports.run = function run(opts, cb) {
+ // Sandbox expects files to have this directory as an ancestor
+ var objcDir = '/tmp/objc';
+ util.mkdirParentSync(objcDir);
+ temp.track();
+ var dir = temp.mkdirSync({dir: objcDir}),
+ objcSandbox = path.resolve('frameworks', 'osx', 'objc.sb');
+
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ var solutionFile = util.codeWriteSync('objc', opts.code, dir, 'main.m'),
+ command = 'clang -lobjc -framework Foundation -o main ' + solutionFile;
+
+ if ("setup" in opts) {
+ util.codeWriteSync('objcHeader', opts.setupHeader, dir, 'setup.h');
+ command = command + ' ' + util.codeWriteSync('objc', opts.setup, dir, 'setup.m');
+ }
+
+ util.exec(command, {'cwd': dir}, function () {
+ run({
+ 'name': 'sandbox-exec',
+ 'args': ['-f', objcSandbox, './main'],
+ 'options': {'cwd': dir}
+ });
+ });
+ },
+ fullProject: function (run) {
+ require('./xcode').fullProject(opts, run);
+ }
+ });
+};
diff --git a/lib/runners/ocaml.js b/lib/runners/ocaml.js
new file mode 100644
index 00000000..1bf4bb24
--- /dev/null
+++ b/lib/runners/ocaml.js
@@ -0,0 +1,13 @@
+var shovel = require('../shovel');
+
+module.exports.run = function run(opts, cb) {
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ run({
+ name: 'ocaml',
+ args: ['-stdin'],
+ stdin: opts.solution
+ });
+ }
+ });
+};
diff --git a/lib/runners/perl.js b/lib/runners/perl.js
new file mode 100644
index 00000000..e7825a5f
--- /dev/null
+++ b/lib/runners/perl.js
@@ -0,0 +1,22 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ config = require('../config'),
+ temp = require('temp');
+
+module.exports.run = function run(opts, cb)
+{
+ temp.track();
+ var dir = temp.mkdirSync('perl');
+
+ shovel.start(opts, cb, {
+ solutionOnly: function (run)
+ {
+ var file = util.codeWriteSync('perl', opts.solution, dir, 'solution.pl')
+ run({name: 'perl', 'args': [file]});
+ },
+ fullProject: function (run)
+ {
+ throw 'Test framework is not supported'
+ }
+ });
+};
\ No newline at end of file
diff --git a/lib/runners/php.js b/lib/runners/php.js
new file mode 100644
index 00000000..d2fadb46
--- /dev/null
+++ b/lib/runners/php.js
@@ -0,0 +1,77 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ config = require('../config');
+
+var PASSED = '';
+var FAILED = '';
+var NEWLINE = '<:LF:>';
+// var NEWLINE = '\n';
+
+module.exports.run = function run(opts, cb)
+{
+ shovel.start(opts, cb, {
+ solutionOnly: function (run)
+ {
+ var code = opts.solution;
+
+ if (opts.setup)
+ {
+ code = opts.setup + ';\n' + code;
+ }
+
+ run({name: 'php', 'args': ['-r', code]});
+ },
+ fullProject: function (run)
+ {
+ var code = [
+ config.snippets.php.bootstrap,
+ (opts.setup || ''),
+ config.snippets.php.beforeUserScript,
+ opts.solution,
+ config.snippets.php.afterUserScript,
+ config.snippets.php.classBegin,
+ opts.fixture,
+ config.snippets.php.classEnd,
+ config.snippets.php.execute
+ ].join('\n');
+
+ run({name: 'php', 'args': ['-r', code]});
+ },
+ //sanitizeStdOut : function (output) {
+ // var lines = output.split('\n');
+ // var success = (lines[lines.length - 2] || '').slice(0, 4) === 'OK (';
+ //
+ // if (success) {
+ // return PASSED + ' All tests passed.';
+ // }
+ //
+ // return FAILED + filterLines(lines).join(NEWLINE);
+ //}
+ });
+};
+
+var filterLines = (function () {
+ var blacklist = [
+ /^PHPUnit \d\.\d\.\d by Seb/,
+ /^\d\) KataTest::testSolution/,
+ /^Time: \d+ ms, Memory:/,
+ /^There was \d+ failure/,
+ /^FAILURES!$/,
+ /^Tests: \d+, Assertions:/
+
+ ];
+
+ /**
+ * Strip lines from output we don't want
+ *
+ * @param array lines
+ * @return array
+ */
+ return function (lines) {
+ return lines.filter(function (line) {
+ return blacklist.every(function (regex) {
+ return !regex.test(line);
+ });
+ });
+ };
+}());
\ No newline at end of file
diff --git a/lib/runners/python.js b/lib/runners/python.js
new file mode 100644
index 00000000..72060186
--- /dev/null
+++ b/lib/runners/python.js
@@ -0,0 +1,42 @@
+var shovel = require('../shovel'),
+ config = require('../config');
+
+module.exports.run = function run(opts, cb) {
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ var code = [opts.setup, opts.solution].join("\n");
+ run({name: 'python', 'args': ['-c', code]});
+ },
+ fullProject: function (run) {
+ var code;
+ with (config.snippets.python) {
+ switch (opts.testFramework) {
+ case 'cw-2':
+ code = [
+ addPythonFramework,
+ requireCw2,
+ opts.setup, opts.solution, opts.fixture].join('\n');
+ break;
+ case 'unittest':
+ code = [
+ opts.setup, opts.solution,
+ addPythonFramework,
+ requireUnittest,
+ opts.fixture,
+ runUnittest].join('\n');
+ break;
+ default:
+ throw new Error('test framework is not supported');
+ }
+ }
+ run({name: 'python', 'args': ['-c', code]});
+ },
+ sanitizeStdErr: function (err) {
+ // get rid of some of the noisy content. We remove line numbers since
+ // they don't match up to what the user sees and will only confuse them.
+ return err.replace(/File "()?", line \d*,/g, '')
+ .replace(' (most recent call last)', '')
+ .replace(' in in ', ' in ');
+ }
+ });
+};
diff --git a/lib/runners/python3.js b/lib/runners/python3.js
new file mode 100644
index 00000000..e51bd510
--- /dev/null
+++ b/lib/runners/python3.js
@@ -0,0 +1,4 @@
+var path = require('path'),
+ pythonRunnerCode = require('fs').readFileSync(path.join(__dirname,'python.js'),'utf8');
+
+eval(pythonRunnerCode.split('python').join('python3'));
diff --git a/lib/runners/r.js b/lib/runners/r.js
new file mode 100644
index 00000000..c5fccf62
--- /dev/null
+++ b/lib/runners/r.js
@@ -0,0 +1,18 @@
+var shovel = require('../shovel');
+
+module.exports.run = function run(opts, cb) {
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ if (opts.setup) {
+ opts.solution = opts.setup + opts.solution;
+ }
+ run({
+ name: 'R',
+ args: ['--vanilla', '--slave', '-e', opts.solution]
+ });
+ },
+ fullProject: function (run) {
+ throw new Error('Test framework is not supported');
+ }
+ });
+};
\ No newline at end of file
diff --git a/lib/runners/racket.js b/lib/runners/racket.js
new file mode 100644
index 00000000..dd0f2c3c
--- /dev/null
+++ b/lib/runners/racket.js
@@ -0,0 +1,25 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ temp = require('temp');
+
+module.exports.run = function run(opts, cb) {
+ temp.track();
+ var racketCodeDir = temp.mkdirSync('racket'),
+ args = ['-l', 'racket/base'];
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ if (opts.setup) {
+ var setupFile = util.codeWriteSync('racket', opts.setup, racketCodeDir, 'setup.rkt');
+ args.push('-t', setupFile);
+ }
+ args.push('-e', opts.solution);
+ run({
+ name: 'racket',
+ args: args
+ });
+ },
+ fullProject: function (run) {
+ throw 'Test framework is not supported';
+ }
+ });
+};
diff --git a/lib/runners/ruby.js b/lib/runners/ruby.js
new file mode 100644
index 00000000..80626a6c
--- /dev/null
+++ b/lib/runners/ruby.js
@@ -0,0 +1,73 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ temp = require('temp');
+
+module.exports.run = function run(opts, cb)
+{
+ shovel.start(opts, cb, {
+ solutionOnly: function (run)
+ {
+ var code = opts.solution;
+
+ if (opts.setup)
+ {
+ code = opts.setup + '\n' + code;
+ }
+
+ run({name: 'ruby', 'args': ['-e', code]});
+ },
+ fullProject: function (run)
+ {
+ switch (opts.testFramework)
+ {
+ case 'cw-2':
+ return prepareCw2(opts, run);
+ case 'rspec':
+ return prepareRSpec(opts, run);
+
+ default:
+ throw 'Test framework is not supported'
+ }
+ },
+ sanitizeStdErr: function(error)
+ {
+ return error.replace(/[\w/-]*(cw-2.rb):[\d]*:in( `(measure|wrap_error|it|describe)'<:LF:>)?/g, '')
+ .replace(/-e:[\d]*:in/g, '')
+ .replace(/<:LF:> `(block in )?(|describe|it)'/g, '')
+ .replace(' ', ' ');
+ },
+ sanitizeStdOut: function(stdout)
+ {
+ return this.sanitizeStdErr(stdout);
+ }
+ });
+};
+
+function prepareCw2(opts, run)
+{
+ var code = ["require('./frameworks/ruby/cw-2')"];
+
+ if (opts.setup)
+ {
+ code.push(opts.setup);
+ }
+
+ code.push(opts.solution);
+ code.push(opts.fixture);
+
+ run({name: 'ruby', 'args': ['-e', code.join('\n')]});
+}
+
+function prepareRSpec(opts, run)
+{
+ temp.track();
+ var dir = temp.mkdirSync('ruby'),
+ code = [opts.solution,opts.fixture];
+
+ if (opts.setup)
+ code.unshift(opts.setup);
+
+ var solution = util.codeWriteSync('ruby', code.join('\n'), dir, 'solution.rb');
+
+ run({name: 'rspec', 'args': [solution, '--require', './frameworks/ruby/cwrspecformatter.rb', '--format', 'CwRSpecFormatter']});
+}
diff --git a/lib/runners/rust.js b/lib/runners/rust.js
new file mode 100644
index 00000000..94653a6e
--- /dev/null
+++ b/lib/runners/rust.js
@@ -0,0 +1,32 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ path = require('path'),
+ temp = require('temp'),
+ exec = require('child_process').exec;
+
+function compile(args, cb) {
+ args.unshift('rustc');
+ exec(args.join(' '), cb);
+}
+
+module.exports.run = function run(opts, cb) {
+ temp.track();
+ var dir = temp.mkdirSync('rust');
+
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ var executable = path.join(dir, 'solution'),
+ solutionFile = util.codeWriteSync('rust', opts.solution, dir, 'solution.rs'),
+ args = [solutionFile, '-o', executable];
+ compile(args, function (error, stdout, stderr) {
+ if (stdout) console.log(stdout);
+ if (stderr) throw new Error(stderr);
+ if (error !== null) throw error;
+ run({'name': executable, 'args': []});
+ });
+ },
+ fullProject: function (run) {
+ throw new Error('Test framework is not supported');
+ }
+ });
+};
\ No newline at end of file
diff --git a/lib/runners/scala.js b/lib/runners/scala.js
new file mode 100644
index 00000000..76757983
--- /dev/null
+++ b/lib/runners/scala.js
@@ -0,0 +1,33 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ path = require('path'),
+ temp = require('temp');
+
+module.exports.run = function run(opts, cb) {
+ temp.track();
+ var dir = temp.mkdirSync('scala');
+
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ var classDirectory = path.join(dir, 'classes'),
+ solutionFile = util.codeWriteSync('scala', opts.solution, dir),
+ solutionClassName = path.basename(solutionFile, '.scala'),
+ args = ['scalac', '-d', classDirectory, solutionFile];
+
+ if (opts.setup) {
+ var setupFile = util.codeWriteSync('scala', opts.setup, dir);
+ args.push(setupFile);
+ }
+ util.mkdirParentSync(classDirectory);
+ util.exec(args.join(' '), function () {
+ run({
+ 'name': 'scala',
+ 'args': ['-classpath', classDirectory, solutionClassName]
+ });
+ });
+ },
+ fullProject: function (run) {
+ throw new Error('Test framework is not supported');
+ }
+ });
+};
diff --git a/lib/runners/swift.js b/lib/runners/swift.js
new file mode 100644
index 00000000..f0588804
--- /dev/null
+++ b/lib/runners/swift.js
@@ -0,0 +1,30 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ temp = require('temp'),
+ path = require('path');
+
+module.exports.run = function run(opts, cb) {
+ // Sandbox expects files to have this directory as an ancestor
+ var swiftDir = '/tmp/swift';
+ util.mkdirParentSync(swiftDir);
+ temp.track();
+ var dir = temp.mkdirSync({dir: swiftDir}),
+ swiftSandbox = path.resolve('frameworks','osx','swift.sb');
+
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ var solutionFile = util.codeWriteSync(null, opts.code, dir, 'main.swift'),
+ command = 'xcrun -sdk macosx swiftc -emit-executable ' + solutionFile;
+ if ("setup" in opts)
+ command = command + ' ' + util.codeWriteSync('swift', opts.setup, dir, 'setup.swift');
+ util.exec(command, {'cwd': dir}, function () {
+ run({'name': 'sandbox-exec',
+ 'args': ['-f', swiftSandbox, './main'],
+ 'options': {'cwd': dir}});
+ });
+ },
+ fullProject: function (run) {
+ require('./xcode').fullProject(opts, run);
+ }
+ });
+};
diff --git a/lib/runners/typescript.js b/lib/runners/typescript.js
new file mode 100644
index 00000000..9d08f4c5
--- /dev/null
+++ b/lib/runners/typescript.js
@@ -0,0 +1,63 @@
+var shovel = require('../shovel'),
+ util = require('../util'),
+ temp = require('temp');
+
+module.exports.run = function run(opts, cb) {
+ var dir = temp.mkdirSync('typescript');
+ shovel.start(opts, cb, {
+ solutionOnly: function (run) {
+ // TODO: Support Setup Code
+
+ var solutionFile = util.codeWriteSync('typescript', opts.solution, dir, 'solution.ts', true);
+ util.exec('tsc ' + solutionFile + ' --module commonjs', function () {
+ run({name: 'node', args: [solutionFile.replace('.ts', '.js')]});
+ });
+ },
+ fullProject: function (run) {
+ switch (opts.testFramework) {
+ case 'mocha':
+ case 'mocha_bdd':
+ return prepareMocha(opts, 'bdd', run);
+ case 'mocha_tdd':
+ return prepareMocha(opts, 'tdd', run);
+ default:
+ throw 'Test framework is not supported'
+ }
+ },
+ sanitizeStdErr: function(error)
+ {
+ error = error || ''
+ return error.replace(/(\()?\/codewars\/[(\w\/-\d.js:) ;]*/g, '')
+ .replace(/( Object. )?[\(]?\[eval\][-:\w\d\)]* at/g, '')
+ .replace(/Module._compile.*/g, '')
+ .replace('Object.Test.handleError ', '')
+ .replace(' ', ' ');
+ },
+ sanitizeStdOut: function(stdout)
+ {
+ return this.sanitizeStdErr(stdout);
+ }
+ });
+
+ function prepareMocha(opts, interfaceType, run) {
+ var dir = temp.mkdirSync('typescript');
+ var code = '';
+
+ if (opts.setup) code = opts.setup + ';\n';
+
+ code += opts.solution + ';\n';
+
+ var codeFile = util.codeWriteSync('typescript', code, dir, 'solution.ts', true);
+
+ util.exec('tsc --module commonjs ' + codeFile, function () {
+ var spec = "var solution = require('./solution.js')\n" + opts.fixture,
+ specFile = util.codeWriteSync('typescript', spec, dir, 'spec.ts', true);
+
+ util.exec('tsc --module commonjs ' + specFile, function () {
+ specFile = specFile.replace('.ts', '.js')
+ run({name: 'mocha', 'args': ['--harmony', '-u', interfaceType, '-R', 'mocha-reporter', specFile]});
+ });
+ });
+ }
+
+};
\ No newline at end of file
diff --git a/lib/runners/xcode.js b/lib/runners/xcode.js
new file mode 100644
index 00000000..17fc5a60
--- /dev/null
+++ b/lib/runners/xcode.js
@@ -0,0 +1,21 @@
+var shovel = require("../shovel"),
+codeWriteSync = require('../util').codeWriteSync,
+_ = require("lodash"),
+path = require("path"),
+temp = require("temp");
+
+module.exports.fullProject = function fullProject(opts,run) {
+ temp.track();
+ var tempCodeDir = temp.mkdirSync("xcode"),
+ script = path.resolve(__dirname, "../../frameworks/osx/run_template.sh"),
+ files = {"CODE": codeWriteSync(opts.language, opts.code, tempCodeDir, "code"),
+ "FIXTURE": codeWriteSync(opts.language, opts.fixture, tempCodeDir, "test")};
+ if (opts.language == "objc")
+ files.CODE_HEADER = codeWriteSync("objcHeader", opts.codeHeader, tempCodeDir, "code.h");
+ if ("setup" in opts) {
+ files.SETUP = codeWriteSync(opts.language, opts.setup, tempCodeDir, "setup");
+ if (opts.language == "objc")
+ files.SETUP_HEADER = codeWriteSync("objcHeader", opts.setupHeader, tempCodeDir, "setup.h");
+ }
+ run({ name: script,
+ options: {"env": _.merge({}, process.env, opts, files)}});};
diff --git a/lib/shovel.js b/lib/shovel.js
new file mode 100644
index 00000000..640350f6
--- /dev/null
+++ b/lib/shovel.js
@@ -0,0 +1,200 @@
+var util = require('util'),
+ spawn = require('child_process').spawn,
+ config = require('./config'),
+ os = require('os');
+
+// used for indicating an error which is related to user code and not an application error.
+// useful for when we run code compilation inside of this host process.
+var CompileError = module.exports.CompileError = function(message) {
+ this.name = "CompileError";
+ this.message = message;
+}
+CompileError.prototype = Error.prototype;
+
+//runs the strategy specified in opts and reports the results of the run, then runs the callback
+module.exports.start = function start(opts, cb, strategies)
+{
+ cb = cb || function (){};
+ if(strategies.compile)
+ {
+ module.exports.compile(opts, function()
+ {
+ run(opts, strategies, function (buffer)
+ {
+ reportBuffer(opts, buffer, strategies);
+ cb(buffer);
+ });
+ }, strategies.compile);
+ }
+ else
+ {
+ run(opts, strategies, function (buffer)
+ {
+ reportBuffer(opts, buffer, strategies);
+ cb(buffer);
+ });
+ }
+};
+
+// given the options provided and a list of strategies on how to handle them, run will pick the
+// appropriate strategy and execute it.
+function run(opts, strategies, cb)
+{
+ function runStrategy(strategy)
+ {
+ // if is error
+ if (typeof strategy === 'string')
+ {
+ cb({stdout: [''], stderr: [strategy], wallTime: 0});
+ }
+ else
+ {
+ exec(opts, strategy.name, strategy.args, strategy.options, strategy.stdin, cb);
+ }
+ }
+
+ try {
+ (!opts.fixture) ? strategies.solutionOnly(runStrategy) : strategies.fullProject(runStrategy);
+ }
+ catch(ex) {
+ // our special error which allows us to raise an exception outside of a child process and still react to it as
+ // if its normal.
+ if (ex.name === "CompileError") {
+ runStrategy(ex.message);
+ }
+ else throw ex;
+ }
+}
+
+function exec(opts, name, args, process_options, process_stdin, cb)
+{
+ var args = args || [],
+ child = spawn(name, args, process_options),
+ buffer = {stdout: [], stderr: []},
+ start = new Date(),
+ finished = false,
+ stdoutLength = 0,
+ maxTime = opts.timeout || config.timeouts[opts.language] || config.timeouts.default;
+
+ function exit(reason)
+ {
+ if (!finished)
+ {
+ child.kill('SIGKILL');
+ if (reason) buffer.stderr.push(reason + '\n');
+ finished = true;
+ }
+ cb(buffer);
+ }
+
+ function cleanupFiles()
+ {
+ // cleanup temp files
+ if (opts.tempFiles)
+ {
+ for (var i = 0, l = opts.tempFiles.length; i < l; i++)
+ {
+ fs.unlink(opts.tempFiles[i]);
+ }
+ delete opts.tempFiles;
+ }
+ }
+
+ if (process_stdin) child.stdin.write(process_stdin);
+
+ // Listen
+ child.stdout.on('data', function (data)
+ {
+ if (!!data)
+ {
+ buffer.stdout.push(data.toString());
+ stdoutLength += data.length;
+ }
+
+ if (stdoutLength > 750000)
+ {
+ buffer.status = 'max_buffer_reached';
+ exit('Max Buffer reached: Too much information has been written to stdout.');
+ }
+ });
+
+ child.stderr.on('data', function (data)
+ {
+ if (!!data) buffer.stderr.push(data.toString());
+ });
+
+ child.on('error', exit);
+
+ // prevent the process from running for too long
+ var timeout = setTimeout(function ()
+ {
+ if (!finished)
+ {
+ buffer.status = 'max_time_reached';
+ exit('Process was terminated. It took longer than ' + maxTime + 'ms to complete');
+ }
+ process.exit(1);
+ }, maxTime);
+
+ child.on('exit', function (code)
+ {
+ clearTimeout(timeout);
+ finished = true;
+ buffer.exitCode = code;
+ buffer.wallTime = new Date() - start;
+
+ cleanupFiles();
+ cb(buffer);
+
+ // if we are within the run script
+ if (!opts.compiling && (process.argv[1] || '').indexOf('/run') >= 0)
+ {
+ //ensure that node exits now, even if processes have forked off
+ process.exit(0);
+ }
+ });
+
+
+ child.stdin.end();
+}
+
+
+function reportBuffer(opts, buffer, strategies)
+{
+ buffer.stdout = buffer.stdout.join('');
+ buffer.stderr = buffer.stderr.join('');
+
+ if (strategies)
+ {
+ if(strategies.transformOutput)
+ {
+ buffer.stdout = strategies.transformOutput(opts);
+ }
+
+ // if there is an error, provide the ability to sanitize it. This is useful for when
+ // output can be noisy.
+ if (buffer.stderr && strategies.sanitizeStdErr)
+ {
+ buffer.stderr = strategies.sanitizeStdErr(buffer.stderr);
+ }
+
+ if (buffer.stdout && strategies.sanitizeStdOut)
+ {
+ buffer.stdout = strategies.sanitizeStdOut(buffer.stdout);
+ }
+ }
+
+ if (opts.format == 'json')
+ {
+ console.log(JSON.stringify(buffer));
+ }
+ else
+ {
+ if (buffer.stdout) console.log(buffer.stdout);
+ if (buffer.stderr) console.error(buffer.stderr);
+ if (buffer.wallTime && opts.debug)
+ {
+ console.info(buffer.wallTime + 'ms');
+ }
+ }
+}
diff --git a/lib/test_utils.js b/lib/test_utils.js
new file mode 100644
index 00000000..4b500e00
--- /dev/null
+++ b/lib/test_utils.js
@@ -0,0 +1,5 @@
+var fs = require('fs'),
+ expect = require('chai').expect,
+ yaml = require('js-yaml'),
+ runner = require('./runner');
+
diff --git a/lib/util.js b/lib/util.js
new file mode 100644
index 00000000..9bfe462a
--- /dev/null
+++ b/lib/util.js
@@ -0,0 +1,75 @@
+var fs = require('fs'),
+ path = require('path'),
+ config = require('./config'),
+ child_process = require('child_process'),
+ yaml = require('js-yaml')
+
+module.exports.exec = function (command, opts, cb) {
+ if (!cb) {
+ cb = opts;
+ opts = null;
+ }
+
+ function handleOutput (error, stdout, stderr) {
+ if (stdout) console.log(stdout);
+ if (stderr) throw new Error(stderr);
+ if (error !== null) throw error;
+ cb();
+ }
+
+ if (opts) child_process.exec(command, opts, handleOutput);
+ else child_process.exec(command, handleOutput);
+};
+
+// mkdir -p
+function mkdirParentSync(dirPath, mode) {
+ var dirs = dirPath.split("/"), partialPath;
+ for (var idx = (dirPath[0] == '/' ? 1 : 0); idx < dirs.length; idx++) {
+ partialPath = dirs.slice(0, idx + 1).join("/");
+ if (!fs.existsSync(partialPath)) {
+ fs.mkdirSync(partialPath, mode);
+ }
+ }
+}
+
+module.exports.mkdirParentSync = mkdirParentSync;
+
+// Infer the name of a file from a module or namespace declaration in the code
+function codeFileName(language, code, defaultFileName) {
+ if (config.moduleRegExs[language]) {
+ var fileExtensionMatch = (new RegExp('\\.' + config.fileExtensions[language] + '$')).exec(defaultFileName),
+ moduleMatch = config.moduleRegExs[language].exec(code);
+
+ return moduleMatch !== null ?
+ moduleMatch[1].replace(/\./g, '/').replace(/-/g, '_') + '.' + config.fileExtensions[language] :
+ fileExtensionMatch !== null ?
+ defaultFileName :
+ defaultFileName + '.' + config.fileExtensions[language];
+ }
+ else {
+ return defaultFileName || language;
+ }
+}
+
+module.exports.codeWriteSync = function (language, code, codeDir, defaultFileName, overwrite) {
+ var fileName = codeFileName(language, code, defaultFileName);
+ if (!(typeof fileName == 'string' || fileName instanceof String)) {
+ throw new Error(["Could not determine valid name from code:\n\n", code].join(""));
+ }
+
+ if (code == "") {
+ throw new Error(["Code cannot be empty!"]);
+ }
+
+ fileName = path.join(codeDir, fileName);
+ if (fs.existsSync(fileName)) {
+ if (!overwrite) {
+ throw new Error(["Could not write code to file ", fileName,
+ " because file already exists:\n\n", code].join(""));
+ }
+ }
+ mkdirParentSync(path.dirname(fileName));
+ fs.writeFileSync(fileName, code);
+ return fileName;
+};
+
diff --git a/package.json b/package.json
new file mode 100644
index 00000000..d6b8e3e5
--- /dev/null
+++ b/package.json
@@ -0,0 +1,58 @@
+{
+ "name": "runner",
+ "description": "Codewars.com code sandbox capabilities",
+ "version": "0.1.6",
+ "author": {
+ "name": "Jake Hoffner",
+ "email": "jake@codewars.com"
+ },
+ "scripts": {
+ "osx-test": "./node_modules/.bin/mocha -t 5000 test/runners/{objc,swift}_spec",
+ "js-test": "mocha -t 5000 test/runners/javascript_spec",
+ "ts-test": "./node_modules/.bin/mocha -t 5000 test/runners/typescript_spec",
+ "cs-test": "./node_modules/.bin/mocha -t 5000 test/runners/csharp_spec",
+ "ruby-test": "./node_modules/.bin/mocha -t 5000 test/runners/ruby_spec"
+ },
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/codewars/runner.git"
+ },
+ "dependencies": {
+ "chai": "1.9.x",
+ "lodash": "^2.4.1",
+ "mocha": "1.19.x",
+ "nomnom": "1.6.x",
+ "temp": "*",
+ "asyncawait": "*",
+ "bluebird": "*",
+ "js-yaml": "*",
+ "mocha-reporter": "git://github.com/codewars/mocha-reporter"
+ },
+ "devDependencies": {
+ "babel-core": "6.7.x",
+ "babel-runtime": "6.6.x",
+ "babel-preset-stage-1": "6.5.x",
+ "babel-preset-react": "6.5.x",
+ "babel-plugin-transform-runtime": "6.7.*",
+ "babel-plugin-check-es2015-constants": "*",
+ "babel-plugin-transform-es2015-arrow-functions": "*",
+ "babel-plugin-transform-es2015-block-scoped-functions": "*",
+ "babel-plugin-transform-es2015-block-scoping": "*",
+ "babel-plugin-transform-es2015-classes": "*",
+ "babel-plugin-transform-es2015-computed-properties": "*",
+ "babel-plugin-transform-es2015-destructuring": "*",
+ "babel-plugin-transform-es2015-duplicate-keys": "*",
+ "babel-plugin-transform-es2015-for-of": "*",
+ "babel-plugin-transform-es2015-function-name": "*",
+ "babel-plugin-transform-es2015-literals": "*",
+ "babel-plugin-transform-es2015-object-super": "*",
+ "babel-plugin-transform-es2015-parameters": "*",
+ "babel-plugin-transform-es2015-shorthand-properties": "*",
+ "babel-plugin-transform-es2015-spread": "*",
+ "babel-plugin-transform-es2015-sticky-regex": "*",
+ "babel-plugin-transform-es2015-template-literals": "*",
+ "babel-plugin-transform-es2015-typeof-symbol": "*",
+ "babel-plugin-transform-es2015-unicode-regex": "*",
+ "babel-plugin-transform-regenerator": "*"
+ }
+}
diff --git a/run-json.js b/run-json.js
new file mode 100644
index 00000000..7725b615
--- /dev/null
+++ b/run-json.js
@@ -0,0 +1 @@
+require('./lib/runner').run(JSON.parse(process.argv[2]));
diff --git a/run.js b/run.js
new file mode 100644
index 00000000..5674e5e4
--- /dev/null
+++ b/run.js
@@ -0,0 +1,52 @@
+var run = require('./lib/runner').run,
+ opts = require("nomnom")
+ .options({
+ code: {
+ abbr: 'c',
+ help: 'code to run'
+ },
+ fixture: {
+ abbr: 'f',
+ help: 'Test fixture code to test with'
+ },
+ setup: {
+ abbr: 's',
+ help: 'Setup code to be used for executing the code'
+ },
+ language: {
+ abbr: 'l',
+ help: 'The language to execute the code in'
+ },
+ testFramework: {
+ abbr: 't',
+ full: 'test-framework',
+ help: 'The language specific framework to run in'
+ },
+ timeout: {
+ help: 'The timeout to be used for running the code. If not specified a language specific default will be used'
+ },
+ format: {
+ help: 'The output format that will be returned. Options are "default" and "json"',
+ default: 'default',
+ choices: ['default', 'json'],
+ abbr: 'fmt'
+ },
+ debug: {
+ abbr: 'd',
+ help: 'Print debugging info',
+ flag: true
+ },
+ version: {
+ abbr: 'v',
+ flag: true,
+ help: 'Print version and exit',
+ callback: function () {
+ return require('./lib/config').version;
+ }
+ }
+ })
+ .help('This utility will run code in a specified language, using the specified testing suite.')
+ .parse();
+
+
+run(opts);
diff --git a/test/runner.js b/test/runner.js
new file mode 100644
index 00000000..708673c8
--- /dev/null
+++ b/test/runner.js
@@ -0,0 +1,42 @@
+var fs = require('fs'),
+ expect = require('chai').expect,
+ yaml = require('js-yaml'),
+ runner = require('../lib/runner');
+
+module.exports.run = runner.run;
+
+// loops through the language specific examples within the examples.yml file and calls the cb function with each individual example
+function iterateCodeExamples(language, cb) {
+ var examples = yaml.safeLoad(fs.readFileSync('./examples/' + language + '.yml', 'utf8'));
+ if (examples) {
+ for (var framework in examples) {
+ for (var example in examples[framework]) {
+ cb(framework, example, examples[framework][example]);
+ }
+ }
+ }
+}
+
+module.exports.assertCodeExamples = function(language) {
+ describe('example challenges', function() {
+ iterateCodeExamples(language, function (framework, name, example) {
+ it ('should define an initial code block', function() {
+ expect(example.initial).to.be.a('string');
+ });
+
+ it ('should have a passing ' + name + ' example', function(done) {
+ runner.run({
+ language: language,
+ setup: example.setup,
+ code: example.answer,
+ fixture: example.fixture,
+ testFramework: framework
+ }, function(buffer) {
+ expect(buffer.stdout).to.not.contain('');
+ expect(buffer.stdout).to.not.contain('');
+ done();
+ });
+ });
+ });
+ });
+};
diff --git a/test/runners/arm_spec.js b/test/runners/arm_spec.js
new file mode 100644
index 00000000..bee01336
--- /dev/null
+++ b/test/runners/arm_spec.js
@@ -0,0 +1,75 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe('arm runner', function () {
+ // commenting out for now since we dont care and this just throws timeout errors sometimes
+ //describe('.run', function () {
+ // it('should handle basic code evaluation (no libc)', function (done) {
+ // runner.run({language: 'arm',
+ // code: [
+ // '.data',
+ // 'message: .ascii "ARMed and dangerous :D"',
+ // 'len = . - message',
+ // '.text',
+ // '.global _start',
+ // '_start:',
+ // ' mov %r0, $1',
+ // ' ldr %r1, =message',
+ // ' ldr %r2, =len',
+ // ' mov %r7, $4',
+ // ' swi $0',
+ // ' mov %r0, $0',
+ // ' mov %r7, $1',
+ // ' swi $0'
+ // ].join('\n')},
+ // function (buffer) {
+ // console.log(buffer);
+ // expect(buffer.stdout).to.equal('ARMed and dangerous :D');
+ // done();
+ // });
+ // });
+ // it('should not use libc even with alternate spelling of global as globl', function (done) {
+ // runner.run({language: 'arm',
+ // code: [
+ // '.data',
+ // 'message: .ascii "Tokyo dialect"',
+ // 'len = . - message',
+ // '.text',
+ // '.globl _start',
+ // '_start:',
+ // ' mov %r0, $1',
+ // ' ldr %r1, =message',
+ // ' ldr %r2, =len',
+ // ' mov %r7, $4',
+ // ' swi $0',
+ // ' mov %r0, $0',
+ // ' mov %r7, $1',
+ // ' swi $0'
+ // ].join('\n')},
+ // function (buffer) {
+ // console.log(buffer);
+ // expect(buffer.stdout).to.equal('Tokyo dialect');
+ // done();
+ // });
+ // });
+ // it('should handle basic code evaluation (with libc)', function (done) {
+ // runner.run({language: 'arm',
+ // code: [
+ // '.global main',
+ // 'main:',
+ // ' push {ip, lr}',
+ // ' ldr r0, =message',
+ // ' bl puts',
+ // ' mov r0, #0',
+ // ' pop {ip, pc}',
+ // 'message: .asciz "ARM works with libc, too"'
+ // ].join('\n')},
+ // function (buffer) {
+ // console.log(buffer);
+ // expect(buffer.stdout).to.equal('ARM works with libc, too\n');
+ // done();
+ // });
+ // });
+ //});
+});
diff --git a/test/runners/bash_spec.js b/test/runners/bash_spec.js
new file mode 100644
index 00000000..ba82c309
--- /dev/null
+++ b/test/runners/bash_spec.js
@@ -0,0 +1,14 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe( 'bash runner', function(){
+ describe( '.run', function(){
+ it( 'should handle basic code evaluation', function(done){
+ runner.run({language: 'bash', code: 'echo 42'}, function(buffer) {
+ expect(buffer.stdout).to.equal('42\n');
+ done();
+ });
+ });
+ });
+});
\ No newline at end of file
diff --git a/test/runners/c_spec.js b/test/runners/c_spec.js
new file mode 100644
index 00000000..7c67c6c9
--- /dev/null
+++ b/test/runners/c_spec.js
@@ -0,0 +1,77 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+describe( 'c runner', function(){
+ describe( '.run', function(){
+ it( 'should handle basic code evaluation', function(done){
+ var solution = ['#include ',
+ 'int main() {',
+ ' printf("I think the next language codewars should support is PL/I. Wikipedia says it\'s still used in production to this day; presumably in nursing homes?");',
+ '}',
+ ''].join('\n');
+
+ runner.run({language: 'c', code: solution}, function(buffer) {
+ expect(buffer.stdout).to.equal("I think the next language codewars should support is PL/I. Wikipedia says it\'s still used in production to this day; presumably in nursing homes?");
+ done();
+ });
+ });
+ it('should handle setup code and imports', function (done) {
+ runner.run({
+ language: 'c',
+ setup: [
+ 'int square(int a) { return a * a ; }'
+ ].join('\n'),
+ code: [
+ '#include ',
+ 'int square(int);',
+ 'int main() {',
+ ' printf("%i",square(5));',
+ '}',
+ ].join('\n')
+ }, function (buffer) {
+ expect(buffer.stdout).to.equal('25');
+ done();
+ });
+ });
+ describe('codewars test framework', function () {
+ it('should be able to run a basic test', function (done) {
+ runner.run({
+ language: 'c',
+ code: [
+ 'int square(int a) { return a * a ; }'
+ ].join('\n'),
+ fixture: [
+ '#include ',
+ 'int square(int);',
+ 'int main() {',
+ ' ASSERT_EQUALS(25,square(5));',
+ '}'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('Test Passed');
+ done();
+ });
+ });
+ it('should be able to run a basic test', function (done) {
+ runner.run({
+ language: 'c',
+ code: [
+ 'int square(int a) { return a * a ; }'
+ ].join('\n'),
+ fixture: [
+ '#include ',
+ 'int square(int);',
+ 'int main() {',
+ ' ASSERT_EQUALS(25,square(5));',
+ '}'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('Test Passed');
+ done();
+ });
+ });
+ });
+ });
+});
\ No newline at end of file
diff --git a/test/runners/clojure_spec.js b/test/runners/clojure_spec.js
new file mode 100644
index 00000000..27565b46
--- /dev/null
+++ b/test/runners/clojure_spec.js
@@ -0,0 +1,194 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+describe('clojure runner', function () {
+ describe('.run', function () {
+ it('should handle basic code evaluation', function (done) {
+ runner.run({
+ language: 'clojure',
+ code: '(println "42")'
+ }, function (buffer) {
+ console.log(buffer.stderr);
+ expect(buffer.stdout).to.equal('42\n');
+ done();
+ });
+ });
+ it('should handle running a namespace with imports', function (done) {
+ runner.run({
+ language: 'clojure',
+ code: [
+ '(ns foo (:require [clojure.edn :as edn]))',
+ '(print (get (edn/read-string "{:code \\"wars\\"}") :code))'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer.stderr);
+ expect(buffer.stdout).to.equal('wars');
+ done();
+ });
+ });
+ it('should handle setup code', function (done) {
+ runner.run({
+ language: 'clojure',
+ code: [
+ '(ns foo.code-code (:require [foo.fighters]))',
+ '(foo.fighters/everlong)'
+ ].join('\n'),
+ setup: [
+ '(ns foo.fighters)',
+ '(defn everlong [] (print "Hello, I\'ve waited here for you"))'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer.stderr);
+ expect(buffer.stdout).to.equal('Hello, I\'ve waited here for you');
+ done();
+ });
+ });
+ });
+ describe('codewars test framework (clojure.test)', function () {
+ it('should be able to run a basic test', function (done) {
+ runner.run({
+ language: 'clojure',
+ code: '(ns empty.namespace)',
+ fixture: [
+ '(ns clojure.test.example (:use clojure.test))',
+ '(deftest add-1-to-1 (testing "arithmetic works" (is (= 2 (+ 1 1)))))'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer.stderr);
+ expect(buffer.stdout).to.contain('add-1-to-1');
+ expect(buffer.stdout).to.contain('arithmetic works');
+ expect(buffer.stdout).to.contain('Test Passed');
+ expect(buffer.stdout).to.contain('');
+ done();
+ });
+ });
+ it('should be able to fail', function (done) {
+ runner.run({
+ language: 'clojure',
+ code: '(ns empty.namespace)',
+ fixture: [
+ '(ns clojure.test.example (:use clojure.test))',
+ '(deftest sad-path (testing "won\'t work" (is (= 2 1) "bad math")))'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer.stderr);
+ expect(buffer.stdout).to.contain('sad-path');
+ expect(buffer.stdout).to.contain('won\'t work');
+ expect(buffer.stdout).to.contain('bad math');
+ expect(buffer.stdout).to.contain('expected: (= 2 1)');
+ expect(buffer.stdout).to.contain('actual: (not (= 2 1))');
+ done();
+ });
+ });
+ it('should print', function (done) {
+ runner.run({
+ language: 'clojure',
+ code: '(ns foo) (defn bar [] (print "yolo") 1)',
+ fixture: [
+ '(ns clojure.test.example (:use clojure.test) (:require [foo]))',
+ '(deftest printing (testing "foo/bar" (is (= 1 (foo/bar)))))'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer.stderr);
+ expect(buffer.stdout).to.contain('printing');
+ expect(buffer.stdout).to.contain('yolofoo/bar');
+ expect(buffer.stdout).to.contain('Test Passed');
+ expect(buffer.stdout).to.contain('');
+ done();
+ });
+ });
+ it('should have an error when there\'s an exception', function (done) {
+ runner.run({
+ language: 'clojure',
+ code: '(ns foo)',
+ fixture: [
+ '(ns clojure.test.example (:use clojure.test))',
+ '(deftest exception (testing "1 / 0" (is (= 1 (/ 1 0)))))'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer.stderr);
+ expect(buffer.stdout).to.contain('exception');
+ expect(buffer.stdout).to.contain('1 / 0');
+ expect(buffer.stdout).to.contain('');
+ expect(buffer.stdout).to.contain('expected: (= 1 (/ 1 0))');
+ expect(buffer.stdout).to.contain('actual: java.lang.ArithmeticException');
+ done();
+ });
+ });
+ it('should handle a typical kata', function (done) {
+ runner.run({
+ language: 'clojure',
+ code: [
+ '(ns last (:refer-clojure :exclude [last]))',
+ '(defn last [lst] (reduce #(do %2) lst))'
+ ].join('\n'),
+ fixture: [
+ '(ns last-test',
+ ' (:require [clojure.test :refer :all]',
+ ' [last :as last])',
+ ' (:refer-clojure :exclude [last]))',
+ '(defn- last [lst] (reduce #(do %2) lst))',
+ '(with-redefs',
+ ' [clojure.core/last',
+ ' (fn [& _] ',
+ ' (throw (Exception. "Sorry! The last built-in is disabled for this kata!")))',
+ ' clojure.core/take-last',
+ ' (fn [& _] ',
+ ' (throw (Exception. "Sorry! The take-last built-in is disabled for this kata!")))]',
+ ' (deftest test-last-function',
+ ' (let [input1 [1 9 13 1 99 9 9 13]',
+ ' input2 (repeatedly (+ 5 (rand-int 10)) #(rand-int 100))',
+ ' input3 "foop"]',
+ ' (testing (prn-str input1)',
+ ' (is (= (last/last input1) 13)))',
+ ' (testing (prn-str input2)',
+ ' (is (= (last/last input2) (last input2))))',
+ ' (testing (str "String: " (prn-str input3))',
+ ' (is (= (last/last input3) (last input3)))))))'
+
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer.stderr);
+ expect(buffer.stdout).to.contain('test-last-function');
+ expect(buffer.stdout).to.contain('[1 9 13 1 99 9 9 13]');
+ expect(buffer.stdout).to.contain('Test Passed');
+ done();
+ });
+ });
+ it('should fail fast', function (done) {
+ runner.run({
+ language: 'clojure',
+ code: '(ns empty.namespace)',
+ fixture: [
+ '(ns clojure.test.example (:use clojure.test))',
+ '(deftest fast-fail',
+ ' (testing "quit early" (is (= 2 1) "not true"))',
+ ' (testing "shouldn\'t happen" (is (= 3 1) "can\'t get here"))',
+ ')'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer.stderr);
+ expect(buffer.stdout).to.contain('fast-fail');
+ expect(buffer.stdout).to.contain('quit early');
+ expect(buffer.stdout).to.contain('not true');
+ expect(buffer.stdout).to.contain('expected: (= 2 1)');
+ expect(buffer.stdout).to.contain('actual: (not (= 2 1))');
+ expect(buffer.stdout).to.not.contain("shouldn't happen");
+ expect(buffer.stdout).to.not.contain("can't get here");
+ done();
+ });
+ });
+ });
+ describe('potpourri', function () {
+ it('test framework should not think HOME is /root', function (done) {
+ runner.run({
+ language: 'clojure',
+ code: '(print (System/getenv "HOME"))'
+ }, function (buffer) {
+ console.log(buffer.stderr);
+ expect(buffer.stdout).to.not.equal('/root');
+ done();
+ });
+ });
+ });
+});
diff --git a/test/runners/coffeescript_spec.js b/test/runners/coffeescript_spec.js
new file mode 100644
index 00000000..25ad4a7c
--- /dev/null
+++ b/test/runners/coffeescript_spec.js
@@ -0,0 +1,46 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe( 'coffeescript runner', function(){
+ describe( '.run', function(){
+ runner.assertCodeExamples('coffeescript');
+
+ it( 'should handle basic code evaluation', function(done){
+ runner.run({language: 'coffeescript', code: 'console.log 42'}, function(buffer) {
+ expect(buffer.stdout ).to.equal('42\n');
+ done();
+ });
+ });
+
+ describe('cw-2', function() {
+ it( 'should handle a basic assertion', function(done){
+ runner.run({language: 'coffeescript', code: 'a = 1', fixture: 'Test.expect a == 1', testFramework: 'cw-2'}, function(buffer) {
+ expect(buffer.stdout ).to.equal('Test Passed\n');
+ done();
+ });
+ });
+ });
+
+ it( 'should handle comments as fixture', function(done){
+ runner.run({language: 'coffeescript', code: 'console.log(42)', fixture: '#', testFramework: 'cw-2'}, function(buffer) {
+ expect(buffer.stdout ).to.equal('42\n');
+ done();
+ });
+ });
+
+ it( 'should handle a basic failed test', function(done){
+ runner.run({language: 'coffeescript', code: 'a = 1', fixture: 'Test.expect(a == 2)', testFramework: 'cw-2'}, function(buffer) {
+ expect(buffer.stdout ).to.equal('Value is not what was expected\n');
+ done();
+ });
+ });
+
+ it( 'should handle logging objects', function(done){
+ runner.run({language: 'coffeescript', code:'console.log {a: 1}', testFramework: 'cw-2'}, function(buffer) {
+ expect(buffer.stdout ).to.equal('{ a: 1 }\n');
+ done();
+ });
+ });
+ });
+});
diff --git a/test/runners/cpp_spec.js b/test/runners/cpp_spec.js
new file mode 100644
index 00000000..bbd2034c
--- /dev/null
+++ b/test/runners/cpp_spec.js
@@ -0,0 +1,51 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+describe('cpp runner', function () {
+ describe('.run', function () {
+ it('should handle basic code evaluation', function (done) {
+ var code = [
+ '#include ',
+ 'int main()',
+ '{ std::cout << "\\\"Within C++, there is a much smaller and cleaner language struggling to get out.\\\" - Bjarn Stroustrup"; }'
+ ].join('\n');
+
+ runner.run({language: 'cpp', code: code}, function (buffer) {
+ expect(buffer.stdout).to.equal("\"Within C++, there is a much smaller and cleaner language struggling to get out.\" - Bjarn Stroustrup");
+ done();
+ });
+ });
+ it('should handle C++11 nonsense', function (done) {
+ var code = [
+ '#include "stdio.h"',
+ 'int main() {',
+ ' auto f = []{ printf("Finally, lambdas in C++. Now if we had typeclasses, purity and laziness we might have a reasonable functional programming language."); };',
+ ' f();',
+ '}'
+ ].join('\n');
+
+ runner.run({language: 'cpp', code: code}, function (buffer) {
+ expect(buffer.stdout).to.equal("Finally, lambdas in C++. Now if we had typeclasses, purity and laziness we might have a reasonable functional programming language.");
+ done();
+ });
+ });
+ it('should handle setup code and imports', function (done) {
+ runner.run({
+ language: 'cpp',
+ setup: [
+ 'int square(int a) { return a * a ; }'
+ ].join('\n'),
+ code: [
+ '#include ',
+ 'int square(int);',
+ 'int main() {',
+ ' std::cout << square(6);',
+ '}',
+ ].join('\n')
+ }, function (buffer) {
+ expect(buffer.stdout).to.equal('36');
+ done();
+ });
+ });
+ });
+});
diff --git a/test/runners/csharp_spec.js b/test/runners/csharp_spec.js
new file mode 100644
index 00000000..8d2f46b3
--- /dev/null
+++ b/test/runners/csharp_spec.js
@@ -0,0 +1,56 @@
+var expect = require('chai').expect,
+ runner = require('../runner'),
+ fs = require('fs');
+
+describe( 'c# runner', function() {
+ describe( '.run', function() {
+ runner.assertCodeExamples('csharp');
+
+ it('should handle basic code evaluation', function (done) {
+ runner.run({language: 'csharp',
+ code: 'public class Hello1 { public static void Main() { System.Console.WriteLine("Hello, World!");}}'
+ }, function (buffer)
+ {
+ //console.log(buffer);
+ expect(buffer.stdout).to.contain('Hello, World!\n');
+ done();
+ });
+ });
+
+ it('should handle basic nunit tests', function (done) {
+ runner.run({ language: 'csharp',
+ code: 'namespace Bank { using System; public class Account { private decimal balance; public void Deposit(decimal amount) { Console.WriteLine("slorgs"); balance += amount; } public void Withdraw(decimal amount) { balance -= amount; } public void TransferFunds(Account destination, decimal amount) { } public decimal Balance { get { return balance; } } } } ',
+ fixture: 'namespace Bank { using NUnit.Framework; [TestFixture] public class AccountTest { [Test] public void TransferFunds() { Account source = new Account(); source.Deposit(200m); Account destination = new Account(); destination.Deposit(150m); source.TransferFunds(destination, 100m); Assert.AreEqual(250m, destination.Balance); Assert.AreEqual(100m, source.Balance); } [Test] public void CheckFunds() { Account source = new Account(); source.Deposit(200m); Account destination = new Account(); destination.Deposit(150m); Assert.AreEqual(200m, source.Balance); } } } ' }, function (buffer)
+ {
+ //console.log(buffer);
+ expect(buffer.stdout).to.contain("slorgs");
+ expect(buffer.stdout).to.contain("");
+ expect(buffer.stdout).to.contain("");
+ expect(buffer.stdout).to.contain("");
+ expect(buffer.stdout).to.contain("");
+ done();
+ });
+ });
+
+ it('should handle bad code', function (done) {
+ runner.run({ language: 'csharp',
+ code: 'namespace Bank { using System; using System.Drawing; public class Account { private decimal balance; public void Deposit(decimal amount) { Console.WriteLine("slorgs"); balance += amount; } public void Withdraw(decimal amount) { balance -= Amount; } public void TransferFunds(Account destination, decimal amount) { } public decimal Balance { get { return balance; } } } } ',
+ fixture: 'namespace Bank { using NUnit.Framework; [TestFixture] public class AccountTest { [Test] public void TransferFunds() { Account source = new Account(); source.Deposit(200m); Account destination = new Account(); destination.Deposit(150m); source.TransferFunds(destination, 100m); Assert.AreEqual(250m, destination.Balance); Assert.AreEqual(100m, source.Balance); } [Test] public void CheckFunds() { Account source = new Account(); source.Deposit(200m); Account destination = new Account(); destination.Deposit(150m); Assert.AreEqual(200m, source.Balance); } } } ' }, function (buffer)
+ {
+ //console.log(buffer);
+ expect(buffer.stdout).to.not.contain("lib/runners/csharp.js");
+ done();
+ });
+ });
+
+ it('should handle partially passed code', function (done) {
+ runner.run({ language: 'csharp',
+ code: 'using System; public class Account { } ',
+ fixture: 'using NUnit.Framework; [TestFixture] public class AccountTest { [Test] public void A() { Assert.AreEqual(1, 1); } [Test] public void Z() { Assert.AreEqual(1, 1); throw new System.Exception(); } } ' }, function (buffer)
+ {
+ expect(buffer.stdout).to.contain("");
+ done();
+ });
+ });
+ });
+});
diff --git a/test/runners/elixir_spec.js b/test/runners/elixir_spec.js
new file mode 100644
index 00000000..f8bd6cf4
--- /dev/null
+++ b/test/runners/elixir_spec.js
@@ -0,0 +1,14 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe( 'elixir runner', function(){
+ describe( '.run', function(){
+ it( 'should handle basic code evaluation', function(done){
+ runner.run({language: 'elixir', code: 'IO.puts "This was real. And it was me. I had lived that life, and I had died that death. I was staring at the very end of me. ― Hilary Duff, Elixir (2010)"'}, function(buffer) {
+ expect(buffer.stdout).to.contain('This was real');
+ done();
+ });
+ });
+ });
+});
\ No newline at end of file
diff --git a/test/runners/erlang_spec.js b/test/runners/erlang_spec.js
new file mode 100644
index 00000000..8a54d448
--- /dev/null
+++ b/test/runners/erlang_spec.js
@@ -0,0 +1,60 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+describe('erlang runner', function () {
+ describe('.run', function () {
+ it('should handle setup code and imports', function (done) {
+ runner.run({
+ language: 'erlang',
+ setup: [
+ '-module(foo).',
+ '-export([bar/0]).',
+ 'bar() -> io:format("baz").'
+ ].join('\n'),
+ code: [
+ 'foo:bar(), init:stop().'
+ ].join('\n')
+ }, function (buffer) {
+ expect(buffer.stdout).to.equal('baz');
+ done();
+ });
+ });
+ it('should handle basic code evaluation', function (done) {
+ runner.run({
+ language: 'erlang',
+ code: 'io:fwrite("42\n"), init:stop().'
+ }, function (buffer) {
+ expect(buffer.stdout).to.equal('42\n');
+ done();
+ });
+ });
+ it('should be running the most recent erlang version', function (done) {
+ runner.run({
+ language: 'erlang',
+ code: 'io:fwrite(erlang:system_info(otp_release)), init:stop().'
+ }, function (buffer) {
+ expect(buffer.stdout).to.equal('18');
+ done();
+ });
+ });
+ });
+ describe('codewars test framework (eunit)', function () {
+ it('should be able to run a basic test', function (done) {
+ runner.run({
+ language: 'erlang',
+ code: [
+ '-module(solution).',
+ '-export([foo/0]).',
+ 'foo() -> "bar".',
+ ].join('\n'),
+ fixture: [
+ 'foo_test() -> "bar" = solution:foo().'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer.stderr);
+ expect(buffer.stdout).to.contain('Test passed.');
+ done();
+ });
+ });
+ });
+});
\ No newline at end of file
diff --git a/test/runners/fsharp_spec.js b/test/runners/fsharp_spec.js
new file mode 100644
index 00000000..4d6951db
--- /dev/null
+++ b/test/runners/fsharp_spec.js
@@ -0,0 +1,14 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe( 'fsharp runner', function(){
+ describe( '.run', function(){
+ it( 'should handle basic code evaluation', function(done){
+ runner.run({language: 'fsharp', code: 'printfn "42"'}, function(buffer) {
+ expect(buffer.stdout).to.equal('42\n');
+ done();
+ });
+ });
+ });
+});
diff --git a/test/runners/gas_spec.js b/test/runners/gas_spec.js
new file mode 100644
index 00000000..acbcd2fb
--- /dev/null
+++ b/test/runners/gas_spec.js
@@ -0,0 +1,47 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe('gas runner', function () {
+ describe('.run', function () {
+ it('should handle basic code evaluation (no libc)', function (done) {
+ runner.run({language: 'gas',
+ code: [
+ ' .global _start',
+ ' .text',
+ '_start:',
+ ' mov $1, %rax',
+ ' mov $1, %rdi',
+ ' mov $message, %rsi',
+ ' mov $8, %rdx',
+ ' syscall',
+ ' mov $60, %rax',
+ ' xor %rdi, %rdi',
+ ' syscall',
+ 'message:',
+ ' .ascii "PV = nRT"'
+ ].join('\n')},
+ function (buffer) {
+ expect(buffer.stdout).to.equal('PV = nRT');
+ done();
+ });
+ });
+ it('should handle basic code evaluation (with libc)', function (done) {
+ runner.run({language: 'gas',
+ code: [
+ ' .global main',
+ ' .text',
+ 'main:',
+ ' mov $message, %rdi',
+ ' call puts',
+ ' ret',
+ 'message:',
+ ' .asciz "Gas works with libc, too"'
+ ].join('\n')},
+ function (buffer) {
+ expect(buffer.stdout).to.equal('Gas works with libc, too\n');
+ done();
+ });
+ });
+ });
+});
diff --git a/test/runners/go_spec.js b/test/runners/go_spec.js
new file mode 100644
index 00000000..52f56dd5
--- /dev/null
+++ b/test/runners/go_spec.js
@@ -0,0 +1,20 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+describe( 'go runner', function(){
+ describe( '.run', function(){
+ it( 'should handle basic code evaluation', function(done){
+ var solution = ['package main',
+ 'import "fmt"',
+ 'func main() {',
+ ' fmt.Println("42")',
+ '}',
+ ''].join('\n');
+
+ runner.run({language: 'go', code: solution}, function(buffer) {
+ expect(buffer.stdout).to.equal('42\n');
+ done();
+ });
+ });
+ });
+});
\ No newline at end of file
diff --git a/test/runners/groovy_spec.js b/test/runners/groovy_spec.js
new file mode 100644
index 00000000..b9da590c
--- /dev/null
+++ b/test/runners/groovy_spec.js
@@ -0,0 +1,14 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe( 'groovy runner', function(){
+ describe( '.run', function(){
+ it( 'should handle basic code evaluation', function(done){
+ runner.run({language: 'groovy', code: "println '42'"}, function(buffer) {
+ expect(buffer.stdout).to.equal('42\n');
+ done();
+ });
+ });
+ });
+});
diff --git a/test/runners/haskell_spec.js b/test/runners/haskell_spec.js
new file mode 100644
index 00000000..678c6d77
--- /dev/null
+++ b/test/runners/haskell_spec.js
@@ -0,0 +1,626 @@
+var expect = require('chai').expect,
+ runner = require('../runner');
+
+describe('haskell runner', function () {
+ describe('.run', function () {
+ runner.assertCodeExamples('haskell');
+
+ it('should handle basic code evaluation', function (done) {
+ runner.run({language: 'haskell',
+ code: 'main = putStrLn "42"'
+ }, function (buffer) {
+ expect(buffer.stdout).to.equal('42\n');
+ done();
+ });
+ });
+ it('should handle running a module with imports', function (done) {
+ runner.run({
+ language: 'haskell',
+ code: [
+ 'module Foo where',
+ 'import Control.Monad (filterM)',
+ 'powerset :: [a] -> [[a]]',
+ 'powerset = filterM (const [True,False])',
+ 'main :: IO ()',
+ 'main = putStr $ show $ powerset [1..3]'
+ ].join('\n')
+ }, function (buffer) {
+ expect(buffer.stdout).to.equal('[[1,2,3],[1,2],[1,3],[1],[2,3],[2],[3],[]]');
+ done();
+ });
+ });
+ it('should handle setup code', function (done) {
+ runner.run({
+ language: 'haskell',
+ code: [
+ 'module Foo where',
+ 'import Foo.Utils as Setup (powerset)',
+ 'main :: IO ()',
+ 'main = putStr $ show $ Setup.powerset [1..3]'
+ ].join('\n'),
+ setup: [
+ 'module Foo.Utils (powerset) where',
+ 'import Control.Monad (filterM)',
+ 'powerset :: [a] -> [[a]]',
+ 'powerset = filterM (const [True,False])'
+ ].join('\n')
+ }, function (buffer) {
+ expect(buffer.stdout).to.equal('[[1,2,3],[1,2],[1,3],[1],[2,3],[2],[3],[]]');
+ done();
+ });
+ });
+ it('should handle skipping module declaration', function (done) {
+ runner.run({
+ language: 'haskell',
+ code: [
+ 'import Foo.Utils as Setup (powerset)',
+ 'main :: IO ()',
+ 'main = putStr $ show $ Setup.powerset [1..3]'
+ ].join('\n'),
+ setup: [
+ 'module Foo.Utils (powerset) where',
+ 'import Control.Monad (filterM)',
+ 'powerset :: [a] -> [[a]]',
+ 'powerset = filterM (const [True,False])'
+ ].join('\n')
+ }, function (buffer) {
+ expect(buffer.stdout).to.equal('[[1,2,3],[1,2],[1,3],[1],[2,3],[2],[3],[]]');
+ done();
+ });
+ });
+ });
+
+ describe('codewars test framework (hspec)', function () {
+ it('should be able to run a basic test', function (done) {
+ runner.run({
+ language: 'haskell',
+ code: 'module Foo where',
+ fixture: [
+ 'module Basic.Test where',
+ 'import Test.Hspec',
+ 'main :: IO ()',
+ 'main = hspec $ do',
+ ' describe "Prelude.head" $ do',
+ ' it "returns the first element of a list" $ do',
+ ' head [23 ..] `shouldBe` (23 :: Int)'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('Prelude.head');
+ expect(buffer.stdout).to.contain('returns the first element of a list');
+ expect(buffer.stdout).to.contain('Test Passed');
+ done();
+ });
+ });
+ it("should work even if test module name isn't specified", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: 'module Foo where',
+ fixture: [
+ 'import Test.Hspec',
+ 'main :: IO ()',
+ 'main = hspec $ do',
+ ' describe "Prelude.head" $ do',
+ ' it "returns the first element of a list" $ do',
+ ' head [23 ..] `shouldBe` (23 :: Int)'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('Prelude.head');
+ expect(buffer.stdout).to.contain('returns the first element of a list');
+ expect(buffer.stdout).to.contain('Test Passed');
+ done();
+ });
+ });
+ it("should work be able to import the code", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: [
+ 'module CodeWars.Solution where',
+ 'x :: Int',
+ 'x = 1'
+ ].join('\n'),
+ fixture: [
+ 'import CodeWars.Solution (x)',
+ 'import Test.Hspec',
+ 'main :: IO ()',
+ 'main = hspec $ do',
+ ' describe "x" $ do',
+ ' it "is 1" $ do',
+ ' x `shouldBe` (1 :: Int)'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('x');
+ expect(buffer.stdout).to.contain('is 1');
+ expect(buffer.stdout).to.contain('Test Passed');
+ done();
+ });
+ });
+ it("should be able to import the code even when code module name is unspecified (the default is module name for the code is 'Main')", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: [
+ 'x :: Int',
+ 'x = 1'
+ ].join('\n'),
+ fixture: [
+ 'module Basic.Test where',
+ 'import Main (x)',
+ 'import Test.Hspec',
+ 'main :: IO ()',
+ 'main = hspec $ do',
+ ' describe "x" $ do',
+ ' it "is 1" $ do',
+ ' x `shouldBe` (1 :: Int)'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('x');
+ expect(buffer.stdout).to.contain('is 1');
+ done();
+ });
+ });
+ it("should report when something is wrong", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: 'x = 1',
+ fixture: [
+ 'module Sad.Path.Test where',
+ 'import Test.Hspec',
+ 'import Main (x)',
+ 'main = hspec $ do',
+ ' describe "x" $ do',
+ ' it "is 2" $ do',
+ ' x `shouldBe` 2'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('x');
+ expect(buffer.stdout).to.contain('is 2');
+ expect(buffer.stdout).to.contain('expected: 2');
+ expect(buffer.stdout).to.contain('but got: 1');
+ done();
+ });
+ });
+ it("should print as a side effect", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: 'x = do putStrLn "Test" ; return 1',
+ fixture: [
+ 'module PrintEffect where',
+ 'import Test.Hspec',
+ 'import Main (x)',
+ 'main = hspec $ do',
+ ' describe "x" $ do',
+ ' it "prints and returns 1" $ do',
+ ' xval <- x',
+ ' xval `shouldBe` 1'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('x');
+ expect(buffer.stdout).to.contain('Test\nprints and returns 1');
+ expect(buffer.stdout).to.contain('Test Passed');
+ done();
+ });
+ });
+ it("should fail fast", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: 'x = 1',
+ fixture: [
+ 'module Fast.Fail.Test where',
+ 'import Test.Hspec',
+ 'import Main (x)',
+ 'main = hspec $ do',
+ ' describe "x" $ do',
+ ' it "is not really 2" $ do',
+ ' x `shouldBe` 2',
+ ' it "should never get here" $ do',
+ ' x `shouldBe` 3'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('x');
+ expect(buffer.stdout).to.contain('is not really 2');
+ expect(buffer.stdout).to.contain('expected: 2');
+ expect(buffer.stdout).to.contain('but got: 1');
+ expect(buffer.stdout).to.not.contain('should never get here');
+ expect(buffer.stdout).to.not.contain('expected: 3 but got: 1');
+ done();
+ });
+ });
+ it("should report exceptions as errors", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: 'x = head []',
+ fixture: [
+ 'module Fast.Fail.Test where',
+ 'import Test.Hspec',
+ 'import Main (x)',
+ 'main = hspec $ do',
+ ' describe "exception" $ do',
+ ' it "should throw" $ do',
+ ' x `shouldBe` 2'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('exception');
+ expect(buffer.stdout).to.contain('should throw');
+ expect(buffer.stdout).to.contain('ErrorCall (Prelude.head: empty list)');
+ done();
+ });
+ });
+ it("should be able to hide a module from the code code", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: [
+ 'module CodeWars.Solution where',
+ 'x :: Int',
+ 'x = 1'
+ ].join('\n'),
+ fixture: [
+ 'import CodeWars.Solution (x)',
+ 'import Test.Hspec',
+ 'main :: IO ()',
+ 'main = hspec $ do',
+ ' describe "Testing BlackListing a module (happy path)" $ do',
+ ' it "Data.Monoid is hidden" $ do',
+ ' hidden $ Module \"Data.Monoid\"'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('Data.Monoid is hidden');
+ expect(buffer.stdout).to.contain('Test Passed');
+ done();
+ });
+ });
+ it("should fail if a module which is supposed to be hidden is not", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: [
+ 'module CodeWars.Solution where',
+ 'import Data.Monoid',
+ 'x :: Int',
+ 'x = 1'
+ ].join('\n'),
+ fixture: [
+ 'import CodeWars.Solution (x)',
+ 'import Test.Hspec',
+ 'main :: IO ()',
+ 'main = hspec $ do',
+ ' describe "Testing BlackListing a module (sad path)" $ do',
+ ' it "Data.Monoid is not hidden!" $ do',
+ ' hidden $ Module \"Data.Monoid\"'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('Data.Monoid is not hidden!');
+ expect(buffer.stdout).to.contain('Import declarations must hide Data.Monoid');
+ done();
+ });
+ });
+ it("should recognize when things are hidden from a particular module", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: [
+ 'module CodeWars.Solution where',
+ 'import Data.List hiding (reverse)',
+ 'reverse :: [a] -> [a]',
+ 'reverse = foldl (flip (:)) []'
+ ].join('\n'),
+ fixture: [
+ 'import CodeWars.Solution (reverse)',
+ 'import Test.Hspec',
+ 'main :: IO ()',
+ 'main = hspec $ do',
+ ' describe "Testing BlackListing a particular function (happy path)" $ do',
+ ' it "Data.List.reverse is hidden" $ do',
+ ' hidden $ FromModule \"Data.List\" \"reverse\"'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('Data.List.reverse is hidden');
+ expect(buffer.stdout).to.contain('Test Passed');
+ done();
+ });
+ });
+ it("should fail when a symbol from a module that ought to be hidden is not", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: [
+ 'module CodeWars.Solution where',
+ 'import Data.List (intercalate)',
+ 'reverse :: [a] -> [a]',
+ 'reverse = foldl (flip (:)) []'
+ ].join('\n'),
+ fixture: [
+ 'import CodeWars.Solution (reverse)',
+ 'import Test.Hspec',
+ 'main :: IO ()',
+ 'main = hspec $ do',
+ ' describe "Testing BlackListing a particular function (sad path)" $ do',
+ ' it "Data.List.intercalate is not hidden!" $ do',
+ ' hidden $ FromModule \"Data.List\" \"intercalate\"'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('Data.List.intercalate is not hidden!');
+ expect(buffer.stdout).to.contain('Import declarations must hide Data.List.intercalate');
+ done();
+ });
+ });
+ it("should fail when a symbol from a module that ought to be hidden is not because the whole module was imported", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: [
+ 'module CodeWars.Solution where',
+ 'import Data.List',
+ 'reverse :: [a] -> [a]',
+ 'reverse = foldl (flip (:)) []'
+ ].join('\n'),
+ fixture: [
+ 'import CodeWars.Solution (reverse)',
+ 'import Test.Hspec',
+ 'main :: IO ()',
+ 'main = hspec $ do',
+ ' describe "Testing BlackListing a particular function (sad path)" $ do',
+ ' it "Data.List.intercalate is not hidden, because the whole module was imported!" $ do',
+ ' hidden $ FromModule \"Data.List\" \"intercalate\"'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('Data.List.intercalate is not hidden, because the whole module was imported!');
+ expect(buffer.stdout).to.contain('Import declarations must hide Data.List.intercalate');
+ done();
+ });
+ });
+ it("should fail when a symbol from a module that ought to be hidden is not because it wasn't hidden properly", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: [
+ 'module CodeWars.Solution where',
+ 'import Data.List hiding (reverse)',
+ 'import Control.Monad hiding ((=<<))',
+ 'reverse :: [a] -> [a]',
+ 'reverse = foldl (flip (:)) []'
+ ].join('\n'),
+ fixture: [
+ 'import CodeWars.Solution (reverse)',
+ 'import Test.Hspec',
+ 'main :: IO ()',
+ 'main = hspec $ do',
+ ' describe "Testing BlackListing a particular function (sad path)" $ do',
+ ' it "Control.Monad.>=> is not hidden, because we forgot!" $ do',
+ ' hidden $ FromModule \"Control.Monad\" \">=>\"'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('Control.Monad.>=> is not hidden, because we forgot!');
+ expect(buffer.stdout).to.contain('Import declarations must hide Control.Monad.>=>');
+ done();
+ });
+ });
+ it("should fail when a function is hidden once in a module, but later imported", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: [
+ 'module CodeWars.Solution where',
+ 'import Data.List hiding (reverse)',
+ 'import Control.Monad hiding ((>=>))',
+ 'import Control.Monad ((>=>))',
+ 'reverse :: [a] -> [a]',
+ 'reverse = foldl (flip (:)) []'
+ ].join('\n'),
+ fixture: [
+ 'import CodeWars.Solution (reverse)',
+ 'import Test.Hspec',
+ 'main :: IO ()',
+ 'main = hspec $ do',
+ ' describe "Testing BlackListing a particular function (sad path)" $ do',
+ ' it "Control.Monad.>=> is not hidden, because we imported it after all!" $ do',
+ ' hidden $ FromModule \"Control.Monad\" \">=>\"'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('Control.Monad.>=> is not hidden, because we imported it after all!');
+ expect(buffer.stdout).to.contain('Import declarations must hide Control.Monad.>=>');
+ done();
+ });
+ });
+ it("should fail when a function is hidden once in a module, but later imported as qualified", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: [
+ 'module CodeWars.Solution where',
+ 'import Data.List hiding (reverse)',
+ 'import Control.Monad hiding ((>=>))',
+ 'import qualified Control.Monad as WhatMonadRhymesWith',
+ 'reverse :: [a] -> [a]',
+ 'reverse = foldl (flip (:)) []'
+ ].join('\n'),
+ fixture: [
+ 'import CodeWars.Solution (reverse)',
+ 'import Test.Hspec',
+ 'main :: IO ()',
+ 'main = hspec $ do',
+ ' describe "Testing BlackListing a particular function (sad path)" $ do',
+ ' it "Control.Monad.>=> is not hidden, because we imported Control.Monad qualified!" $ do',
+ ' hidden $ FromModule \"Control.Monad\" \">=>\"'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('Control.Monad.>=> is not hidden, because we imported Control.Monad qualified!');
+ expect(buffer.stdout).to.contain('Import declarations must hide Control.Monad.>=>');
+ done();
+ });
+ });
+ it("should be able to hide Prelude functions", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: [
+ 'module CodeWars.Solution where',
+ 'import Prelude hiding (reverse)',
+ 'reverse :: [a] -> [a]',
+ 'reverse = foldl (flip (:)) []'
+ ].join('\n'),
+ fixture: [
+ 'import CodeWars.Solution (reverse)',
+ 'import Test.Hspec',
+ 'main :: IO ()',
+ 'main = hspec $ do',
+ ' describe "Testing BlackListing a particular function from Prelude (happy path)" $ do',
+ ' it "Prelude.reverse is hidden" $ do',
+ ' hidden $ FromModule \"Prelude\" \"reverse\"'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('Prelude.reverse is hidden');
+ expect(buffer.stdout).to.contain('Test Passed');
+ done();
+ });
+ });
+ it("should detect when we failed to hide a Prelude function", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: [
+ 'module CodeWars.Solution where',
+ 'reverse :: [a] -> [a]',
+ 'reverse = foldl (flip (:)) []'
+ ].join('\n'),
+ fixture: [
+ 'import CodeWars.Solution (reverse)',
+ 'import Test.Hspec',
+ 'main :: IO ()',
+ 'main = hspec $ do',
+ ' describe "Testing BlackListing a particular function from Prelude (sad path)" $ do',
+ ' it "Prelude.reverse is NOT hidden!" $ do',
+ ' hidden $ FromModule \"Prelude\" \"reverse\"'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('Prelude.reverse is NOT hidden!');
+ expect(buffer.stdout).to.contain('');
+ done();
+ });
+ });
+ it("should detect when we hid a Prelude function, even when we forgot to say our module name", function (done) {
+ runner.run({
+ language: 'haskell',
+ code: [
+ 'import Prelude hiding (reverse)',
+ 'reverse :: [a] -> [a]',
+ 'reverse = foldl (flip (:)) []'
+ ].join('\n'),
+ fixture: [
+ 'module Default.Module.Name.Is.Main.Test where',
+ 'import qualified Main',
+ 'import Test.Hspec',
+ 'main :: IO ()',
+ 'main = hspec $ do',
+ ' describe "Testing BlackListing a particular function from Prelude, when module name is not specified (happy path)" $ do',
+ ' it "Prelude.reverse is indeed hidden" $ do',
+ ' hidden [FromModule \"Prelude\" \"reverse\"]',
+ ' describe "Main.reverse reverses a thing" $ do',
+ ' it "Main.reverse is functionally the same as Prelude.reverse" $ do',
+ ' let testInput = [1..10]',
+ ' Main.reverse testInput `shouldBe` reverse testInput',
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('Prelude.reverse is indeed hidden');
+ expect(buffer.stdout).to.contain('Main.reverse is functionally the same as Prelude.reverse');
+ expect(buffer.stdout).to.contain('');
+ done();
+ });
+ });
+ });
+ describe('haskell', function () {
+ it('can handle SQLite interaction', function (done) {
+ runner.run({language: 'haskell',
+ code: [
+ '{-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies #-}',
+ '{-# LANGUAGE OverloadedStrings, GADTs, FlexibleContexts, MultiParamTypeClasses #-}',
+ '{-# LANGUAGE NoMonomorphismRestriction, GeneralizedNewtypeDeriving #-}',
+ 'module Movies where',
+ 'import Database.Persist (insertMany)',
+ 'import Database.Persist.Sqlite (runSqlite, runMigration)',
+ 'import Database.Persist.TH (mkPersist, mkMigrate, persistUpperCase, share, sqlSettings)',
+ 'share [mkPersist sqlSettings, mkMigrate "migrateTables"] [persistUpperCase|',
+ 'Movies',
+ ' title String',
+ ' year Int',
+ ' rating Int',
+ ' deriving Eq Show',
+ '|]',
+ 'mkMoviesDB :: IO ()',
+ 'mkMoviesDB = runSqlite "/tmp/movies.db" $ do',
+ ' runMigration migrateTables',
+ ' insertMany',
+ ' [ Movies "Rise of the Planet of the Apes" 2011 77',
+ ' , Movies "Dawn of the Planet of the Apes" 2014 91',
+ ' , Movies "Alien" 1979 97',
+ ' , Movies "Aliens" 1986 98',
+ ' , Movies "Mad Max" 1979 95',
+ ' , Movies "Mad Max 2: The Road Warrior" 1981 100',
+ ' ]',
+ ' return ()'
+ ].join('\n'),
+ fixture: [
+ '{-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies #-}',
+ '{-# LANGUAGE OverloadedStrings, GADTs, FlexibleContexts #-}',
+ '{-# LANGUAGE NoMonomorphismRestriction #-}',
+ 'import Test.Hspec',
+ 'import Database.Persist',
+ 'import Control.Monad.IO.Class (MonadIO(liftIO))',
+ 'import Database.Persist.Sqlite (runSqlite)',
+ 'import Database.Persist.Sql (rawQuery)',
+ 'import Data.Conduit (($$), (=$))',
+ 'import Data.Conduit.List as CL',
+ 'import Data.Text (pack, unpack)',
+ 'import Movies (mkMoviesDB)',
+ 'import Control.Monad (when)',
+ 'import System.Posix.Files (fileExist)',
+ 'import System.Directory (removeFile)',
+
+ 'data Movie = Movie String Integer Integer deriving (Eq, Show)',
+
+ 'moviesDBFileName :: String',
+ 'moviesDBFileName = "/tmp/movies.db"',
+
+ 'getMovies :: IO [Movie]',
+ 'getMovies = runSqlite (pack moviesDBFileName) $ do',
+ ' rawQuery "select Title, Year, Rating from Movies" [] $$ CL.map toMovie =$ consume',
+ ' where',
+ ' toMovie [PersistText title, PersistInt64 year, PersistInt64 rating] =',
+ ' Movie (unpack title) (toInteger year) (toInteger rating)',
+
+ 'deleteIfExists :: String -> IO ()',
+ 'deleteIfExists fileName = do',
+ ' exists <- fileExist fileName',
+ ' when exists $ removeFile fileName',
+
+ 'main :: IO ()',
+ 'main = hspec $ do',
+ ' describe "/tmp/movies.db" ',
+ ' $ before (deleteIfExists moviesDBFileName)',
+ ' $ after (deleteIfExists moviesDBFileName)',
+ ' $ do',
+ ' it "contains the movies we expect" $ do',
+ ' mkMoviesDB',
+ ' movies <- getMovies',
+ ' liftIO $ movies `shouldBe` [ Movie "Rise of the Planet of the Apes" 2011 77',
+ ' , Movie "Dawn of the Planet of the Apes" 2014 91',
+ ' , Movie "Alien" 1979 97,Movie "Aliens" 1986 98',
+ ' , Movie "Mad Max" 1979 95',
+ ' , Movie "Mad Max 2: The Road Warrior" 1981 100]'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('Test Passed');
+ done();
+ });
+ });
+ });
+});
diff --git a/test/runners/java_spec.js b/test/runners/java_spec.js
new file mode 100644
index 00000000..8c4e573e
--- /dev/null
+++ b/test/runners/java_spec.js
@@ -0,0 +1,67 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe('java runner', function () {
+ describe('.run', function () {
+ it('should handle basic code evaluation', function (done) {
+ runner.run({language: 'java',
+ code: [
+ 'class Solution {',
+ ' static void main(String[] args){',
+ ' System.out.println("42");',
+ ' }',
+ '}'].join('\n')
+ }, function (buffer) {
+ expect(buffer.stdout).to.contain('42\n');
+ done();
+ });
+ });
+ });
+ describe('junit', function () {
+ it('should handle basic junit tests', function (done) {
+ runner.run({language: 'java',
+ code: 'public class Solution {\n'
+ + ' public Solution(){}\n'
+ + ' public int testthing(){return 3;}\n'
+ + '}\n',
+ fixture: 'import static org.junit.Assert.assertEquals;\n'
+ + 'import org.junit.Test;\n'
+ + 'import org.junit.runners.JUnit4;\n'
+ + 'public class TestFixture {\n'
+ + ' public TestFixture(){}'
+ + ' @Test\n'
+ + ' public void myTestFunction(){\n'
+ + ' Solution s = new Solution();\n'
+ + ' assertEquals("wow", 3, s.testthing());\n'
+ + ' System.out.println("test out");\n'
+ + '}}'
+ }, function (buffer) {
+ expect(buffer.stdout).to.contain('myTestFunction(TestFixture)<:LF:>\ntest out\nTest Passed<:LF:>\n');
+ done();
+ });
+ });
+ it('should handle junit tests failing', function (done) {
+ runner.run({language: 'java',
+ code: 'public class Solution {\n'
+ + ' public Solution(){}\n'
+ + ' public int testthing(){return 3;}\n'
+ + '}\n',
+ fixture: 'import static org.junit.Assert.assertEquals;\n'
+ + 'import org.junit.Test;\n'
+ + 'import org.junit.runners.JUnit4;\n'
+ + 'public class TestFixture {\n'
+ + ' public TestFixture(){}'
+ + ' @Test\n'
+ + ' public void myTestFunction(){\n'
+ + ' Solution s = new Solution();\n'
+ + ' assertEquals("Failed Message", 5, s.testthing());\n'
+ + ' System.out.println("test out");\n'
+ + '}}'
+ }, function (buffer) {
+ expect(buffer.stdout).to.contain('myTestFunction(TestFixture)<:LF:>\nFailed Message expected:<5> but was:<3><:LF:>\n');
+ done();
+ });
+ });
+ });
+});
diff --git a/test/runners/javascript_spec.js b/test/runners/javascript_spec.js
new file mode 100644
index 00000000..79d34e20
--- /dev/null
+++ b/test/runners/javascript_spec.js
@@ -0,0 +1,220 @@
+var expect = require('chai').expect,
+ runner = require('../runner');
+
+describe( 'javascript runner', function(){
+ describe( '.run', function(){
+ runner.assertCodeExamples('javascript');
+
+ it( 'should handle basic code evaluation', function(done){
+ runner.run({language: 'javascript', code: 'console.log(42)'}, function(buffer) {
+ expect(buffer.stdout).to.equal('42\n');
+ done();
+ });
+ });
+ it( 'should handle es6 code evaluation', function(done){
+ runner.run({language: 'javascript', code: 'let a = 42; console.log(42);'}, function(buffer) {
+ expect(buffer.stdout).to.equal('42\n');
+ done();
+ });
+ });
+
+ it( 'should handle bad syntax', function(done){
+ runner.run({language: 'javascript', code: 'var a = function(){returns 42;};\na();'}, function(buffer) {
+ expect(buffer.stderr).to.contain('kata: Unexpected token:27');
+ done();
+ });
+ });
+ it( 'should handle react syntax', function(done){
+ runner.run({language: 'javascript', code: 'var React = require("react");var ReactDOM = require("react-dom/server");var div = Test
;console.log(ReactDOM.renderToStaticMarkup(div));'}, function(buffer) {
+ expect(buffer.stdout).to.contain('Test
');
+ done();
+ });
+ });
+ it( 'should load libraries', function(done){
+ runner.run({language: 'javascript', code: 'var _ = require("lodash");console.log(_.map([1], n => n * 2));'}, function(buffer) {
+ expect(buffer.stdout).to.contain('[ 2 ]');
+ done();
+ });
+ });
+ it( 'should handle stderr', function(done){
+ runner.run({language: 'javascript', code: 'console.error("404 Not Found")'}, function(buffer) {
+ expect(buffer.stderr).to.equal('404 Not Found\n');
+ done();
+ });
+ });
+ it( 'should handle stdout and stderr', function(done){
+ runner.run({language: 'javascript', code: 'console.log("stdout"); console.error("stderr")'}, function(buffer) {
+ expect(buffer.stdout).to.equal('stdout\n');
+ expect(buffer.stderr).to.equal('stderr\n');
+ done();
+ });
+ });
+
+ describe('mocha bdd', function() {
+ it( 'should handle outputting objects', function(done){
+ runner.run({
+ language: 'javascript',
+ code: 'var a = {b: 2};console.log(this);',
+ fixture: 'var assert = require("chai").assert;describe("test", function(){it("should be 2", function(){assert.equal(2, a.b);})});',
+ testFramework: 'mocha_bdd'},
+ function(buffer) {
+ expect(buffer.stdout).to.contain('');
+ done();
+ });
+ });
+ it( 'should handle failures', function(done){
+ runner.run({
+ language: 'javascript',
+ code: 'a = {b: 2};',
+ fixture: 'var assert = require("chai").assert;describe("test", function(){describe("failures", function(){it("should be 1", function(){assert.equal(1, a.b);})})});',
+ testFramework: 'mocha_bdd'},
+ function(buffer) {
+ expect(buffer.stdout).to.contain('');
+ done();
+ });
+ });
+ it( 'should handle errors', function(done){
+ runner.run({
+ language: 'javascript',
+ code: 'a = {b: 2};',
+ fixture: 'describe("test", function(){describe("failures", function(){it("should be 1", function(){throw new Error("test error");})})});',
+ testFramework: 'mocha_bdd'},
+ function(buffer) {
+ expect(buffer.stdout).to.contain('');
+ done();
+ });
+ });
+ });
+
+ describe('mocha tdd', function() {
+ it( 'should handle outputting objects', function(done){
+ runner.run({
+ language: 'javascript',
+ code: 'var a = {b: 2};console.log(this);',
+ fixture: 'var assert = require("chai").assert;suite("test", function(){test("should be 2", function(){assert.equal(2, a.b);})});',
+ testFramework: 'mocha_tdd'},
+ function(buffer) {
+ expect(buffer.stdout).to.contain('');
+ done();
+ });
+ });
+ it( 'should handle failures', function(done){
+ runner.run({
+ language: 'javascript',
+ code: 'a = {b: 2};',
+ fixture: 'var assert = require("assert"); suite("test", function(){suite("failures", function(){test("should be 1", function(){assert.equal(1, a.b);})})});',
+ testFramework: 'mocha_tdd'},
+ function(buffer) {
+ expect(buffer.stdout).to.contain('');
+ done();
+ });
+ });
+ it( 'should handle errors', function(done){
+ runner.run({
+ language: 'javascript',
+ code: 'a = {b: 2};',
+ fixture: 'suite("test", function(){suite("failures", function(){test("should be 1", function(){throw new Error("test error");})})});',
+ testFramework: 'mocha_tdd'},
+ function(buffer) {
+ expect(buffer.stdout).to.contain('');
+ done();
+ });
+ });
+ });
+
+ describe('cw-2', function() {
+ it( 'should handle outputting objects', function(done){
+ runner.run({language: 'javascript', code: 'a = {b: 2};', fixture: 'Test.expect(false, a);', testFramework: 'cw-2'}, function(buffer) {
+ expect(buffer.stdout).to.contain('{ b: 2 }');
+ expect(buffer.stdout).to.contain('');
+ done();
+ });
+ });
+
+ it('should handle a basic assertion', function(done){
+ runner.run({language: 'javascript', code: 'a = 1', fixture: 'Test.expect(a == 1);', testFramework: 'cw-2'}, function(buffer) {
+ expect(buffer.stdout).to.equal('Test Passed\n');
+ done();
+ });
+ });
+
+ it('should handle comments as fixture', function(done){
+ runner.run({language: 'javascript', code: 'console.log(42)', fixture: '//', testFramework: 'cw-2'}, function(buffer) {
+ expect(buffer.stdout).to.equal('42\n');
+ done();
+ });
+ });
+
+ it('should handle a basic failed test', function(done){
+ runner.run({language: 'javascript', code: 'a = 1', fixture: 'Test.expect(a == 2)', testFramework: 'cw-2'}, function(buffer) {
+ expect(buffer.stdout).to.equal('Value is not what was expected\n');
+ done();
+ });
+ });
+
+ it('should handle logging objects', function(done){
+ runner.run({language: 'javascript', code:'console.log({a: 1});', testFramework: 'cw-2'}, function(buffer) {
+ expect(buffer.stdout).to.equal('{ a: 1 }\n');
+ done();
+ });
+ });
+
+ describe('error handling', function() {
+ it( 'should handle a mix of failures and successes', function(done) {
+ runner.run({language: 'javascript',
+ code:'var a = 1',
+ fixture: 'describe("test", function(){\n' +
+ 'it("test1", function(){ Test.expect(false) });' +
+ 'it("test2", function(){ Test.expect(true)});})',
+ testFramework: 'cw-2'}, function(buffer) {
+ expect(buffer.stdout).to.contain('Value is not what was expected');
+ expect(buffer.stdout).to.contain('Test Passed');
+ done();
+ });
+ });
+ it('should gracefully handle custom errors', function(done) {
+ runner.run({language: 'javascript',
+ code:'var a = 1',
+ fixture: 'describe("test", function(){\n' +
+ 'it("test1", function(){ throw "boom!" });' +
+ 'it("test2", function(){ Test.expect(true)});})',
+ testFramework: 'cw-2'}, function(buffer) {
+ expect(buffer.stdout).to.contain('');
+ expect(buffer.stdout).to.contain('boom!');
+ expect(buffer.stdout).to.contain('Test Passed');
+ done();
+ });
+ });
+ it('should gracefully handle reference errors', function(done) {
+ runner.run({language: 'javascript',
+ code:'var a = 1',
+ fixture: 'describe("test", function(){\n' +
+ 'it("test1", function(){ b.test() });' +
+ 'it("test2", function(){ Test.expect(true)});})',
+ testFramework: 'cw-2'}, function(buffer) {
+ expect(buffer.stdout).to.contain('');
+ expect(buffer.stdout).to.contain('<:LF:>');
+ expect(buffer.stdout).to.contain('ReferenceError:');
+ expect(buffer.stdout).to.not.contain('[eval]');
+ expect(buffer.stdout).to.contain('Test Passed');
+ done();
+ });
+ });
+ it('should gracefully top level handle reference errors', function(done) {
+ runner.run({language: 'javascript',
+ code:'b.test()',
+ fixture: 'describe("test", function(){\n' +
+ 'it("test2", function(){ Test.expect(true)});})',
+ testFramework: 'cw-2'}, function(buffer) {
+ expect(buffer.stdout).to.contain('');
+ expect(buffer.stdout).to.contain('<:LF:>');
+ expect(buffer.stdout).to.contain('ReferenceError:');
+ expect(buffer.stdout).to.not.contain('[eval]');
+ expect(buffer.stdout).to.not.contain('Object.Test.handleError');
+ done();
+ });
+ });
+ });
+ });
+ });
+});
diff --git a/test/runners/julia_spec.js b/test/runners/julia_spec.js
new file mode 100644
index 00000000..e69de29b
diff --git a/test/runners/lisp_spec.js b/test/runners/lisp_spec.js
new file mode 100644
index 00000000..76af68c2
--- /dev/null
+++ b/test/runners/lisp_spec.js
@@ -0,0 +1,30 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe( 'lisp runner', function(){
+ describe( '.run', function(){
+ it( 'should handle basic code evaluation', function(done){
+ runner.run({language: 'lisp', code: '(format t "~a~%" 42)'}, function(buffer) {
+ expect(buffer.stdout).to.equal('42\n');
+ done();
+ });
+ });
+
+ it('should handle setup code and imports', function (done) {
+ runner.run({
+ language: 'lisp',
+ setup: [
+ '(defun twice (x) (+ x x))'
+ ].join('\n'),
+ code: [
+ '(format t "~a~%" (twice 4))'
+ ].join('\n')
+ }, function (buffer) {
+ expect(buffer.stdout).to.equal('8\n');
+ done();
+ });
+ });
+
+ });
+});
diff --git a/test/runners/lua_spec.js b/test/runners/lua_spec.js
new file mode 100644
index 00000000..20bcaa08
--- /dev/null
+++ b/test/runners/lua_spec.js
@@ -0,0 +1,14 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe( 'lua runner', function(){
+ describe( '.run', function(){
+ it( 'should handle basic code evaluation', function(done){
+ runner.run({language: 'lua', code: 'print(42)'}, function(buffer) {
+ expect(buffer.stdout).to.equal('42\n');
+ done();
+ });
+ });
+ });
+});
\ No newline at end of file
diff --git a/test/runners/nasm_spec.js b/test/runners/nasm_spec.js
new file mode 100644
index 00000000..1c06d1bf
--- /dev/null
+++ b/test/runners/nasm_spec.js
@@ -0,0 +1,48 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe('nasm runner', function () {
+ describe('.run', function () {
+ it('should handle basic code evaluation (no libc)', function (done) {
+ runner.run({language: 'nasm',
+ code: [
+ ' global _start',
+ ' section .text',
+ '_start:',
+ ' mov rax, 1',
+ ' mov rdi, 1',
+ ' mov rsi, message',
+ ' mov rdx, 25',
+ ' syscall',
+ ' mov eax, 60',
+ ' xor rdi, rdi',
+ ' syscall',
+ 'message:',
+ 'db "Hello, Netwide Assembler!", 25'
+ ].join('\n')},
+ function (buffer) {
+ expect(buffer.stdout).to.equal('Hello, Netwide Assembler!');
+ done();
+ });
+ });
+ it('should handle basic code evaluation (with libc)', function (done) {
+ runner.run({language: 'nasm',
+ code: [
+ ' global main',
+ ' extern puts',
+ ' section .text',
+ 'main:',
+ ' mov rdi, message',
+ ' call puts',
+ ' ret',
+ 'message:',
+ 'db "Netwide Assembler together with LIBC! Let\'s Port Codewars From Rails to THIS! \\m/", 0'
+ ].join('\n')},
+ function (buffer) {
+ expect(buffer.stdout).to.equal('Netwide Assembler together with LIBC! Let\'s Port Codewars From Rails to THIS! \\m/\n');
+ done();
+ });
+ });
+ });
+});
diff --git a/test/runners/objc_spec.js b/test/runners/objc_spec.js
new file mode 100644
index 00000000..0502622d
--- /dev/null
+++ b/test/runners/objc_spec.js
@@ -0,0 +1,146 @@
+if (process.platform == 'darwin') {
+ var expect = require('chai').expect;
+ var runner = require('../runner');
+
+ describe( 'objc runner', function(){
+ describe( '.run', function(){
+ it( 'should handle basic code evaluation', function(done){
+ runner.run({
+ language: 'objc',
+ code: [
+ '#import ',
+ '#import ',
+ 'int main(void)',
+ '{',
+ 'NSLog(@"Object-oriented programming is an exceptionally bad idea which could only have originated in California. - Edsger Dijkstra");',
+ 'return 0;',
+ '}'
+ ].join('\n')
+ }, function(buffer) {
+ console.log(buffer);
+ expect(buffer.stderr).to.contain('Object-oriented programming is an exceptionally bad idea which could only have originated in California. - Edsger Dijkstra\n');
+ done();
+ });
+ });
+ it('should handle basic code setup code', function(done) {
+ runner.run({
+ language: 'objc',
+ setup: 'int foo(void) { return 999; }',
+ setupHeader: [
+ '//',
+ '// test_setup.h',
+ 'int foo(void);'
+ ].join('\n'),
+ code: [
+ '#import ',
+ '#import ',
+ '#import "test_setup.h"',
+ 'int main(void)',
+ '{',
+ 'NSLog(@"A string: %i", foo());',
+ 'return 0;',
+ '}'
+ ].join('\n')
+ }, function(buffer) {
+ console.log(buffer);
+ expect(buffer.stderr).to.contain('999');
+ done();
+ });
+ });
+ it('should handle broken fixture', function(done) {
+ runner.run({
+ language: 'objc',
+ code: 'int flah(void) { return 9999; }',
+ codeHeader: [
+ '// code.h',
+ 'int flah(void);'
+ ].join('\n'),
+ fixture: [
+ '#import ',
+ '@interface MyAppTests : XCTestCase',
+ '@end',
+ '@implementation MyAppTests',
+ '- (void)testXXXX',
+ '{',
+ 'XCTAssert(1)',
+ '}',
+ '@end'
+ ].join('\n')
+
+
+ }, function(buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('test.m:7:13: error: expected');
+ done();
+ });
+ });
+ it('should handle test fixture', function(done) {
+ runner.run({
+ language: 'objc',
+ code: 'float flah(void) { return 9999; }',
+ codeHeader: [
+ '// code.h',
+ 'float flah(void);'
+ ].join('\n'),
+ fixture: [
+ '#import ',
+ '#include "code.h"',
+ '@interface MyAppTests : XCTestCase',
+ '@end',
+ '@implementation MyAppTests',
+ '- (void)testXXXX',
+ '{',
+ 'XCTAssert(flah() == 9999);',
+ '}',
+ '@end'
+ ].join('\n')
+
+
+ }, function(buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain("Test Case '-[MyAppTests testXXXX]' passed");
+ done();
+ });
+ });
+ it('should handle test fixture with setup', function(done) {
+ runner.run({
+ language: 'objc',
+ setup: [
+ 'float bar(void) { return 30.75; }'
+ ].join('\n'),
+ setupHeader: [
+ '// bar.h',
+ 'float bar(void);'
+ ].join('\n'),
+ code: [
+ '#include "bar.h"',
+ 'float foo(void) { return bar(); }'
+ ].join('\n'),
+ codeHeader: [
+ '// payload.h',
+ 'float foo(void);'
+ ].join('\n'),
+ fixture: [
+ '#import ',
+ '#include "payload.h"',
+ '@interface FooOBJCTests : XCTestCase',
+ '@end',
+ '@implementation FooOBJCTests',
+ '- (void)testFOO',
+ '{',
+ 'XCTAssertEqual(foo(), 30.75);',
+ '}',
+ '@end'
+ ].join('\n')
+
+
+ }, function(buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain("Test Case '-[FooOBJCTests testFOO]' passed");
+ done();
+ });
+ });
+
+ });
+ });
+}
diff --git a/test/runners/ocaml_spec.js b/test/runners/ocaml_spec.js
new file mode 100644
index 00000000..9cc74f97
--- /dev/null
+++ b/test/runners/ocaml_spec.js
@@ -0,0 +1,14 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe( 'ocaml runner', function(){
+ describe( '.run', function(){
+ it( 'should handle basic code evaluation', function(done){
+ runner.run({language: 'ocaml', code: 'print_string "42\n";;'}, function(buffer) {
+ expect(buffer.stdout).to.equal('42\n');
+ done();
+ });
+ });
+ });
+});
diff --git a/test/runners/perl_spec.js b/test/runners/perl_spec.js
new file mode 100644
index 00000000..03a3eb8d
--- /dev/null
+++ b/test/runners/perl_spec.js
@@ -0,0 +1,14 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe( 'perl runner', function(){
+ describe( '.run', function(){
+ it( 'should handle basic code evaluation', function(done){
+ runner.run({language: 'perl', code: 'print 42'}, function(buffer) {
+ expect(buffer.stdout).to.equal('42');
+ done();
+ });
+ });
+ });
+});
\ No newline at end of file
diff --git a/test/runners/php_spec.js b/test/runners/php_spec.js
new file mode 100644
index 00000000..f2d08839
--- /dev/null
+++ b/test/runners/php_spec.js
@@ -0,0 +1,14 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe( 'php runner', function(){
+ describe( '.run', function(){
+ it( 'should handle basic code evaluation', function(done){
+ runner.run({language: 'php', solution: 'echo 42 . PHP_EOL;'}, function(buffer) {
+ expect(buffer.stdout).to.equal('42\n');
+ done();
+ });
+ });
+ });
+});
\ No newline at end of file
diff --git a/test/runners/python3_spec.js b/test/runners/python3_spec.js
new file mode 100644
index 00000000..6a7ae1b6
--- /dev/null
+++ b/test/runners/python3_spec.js
@@ -0,0 +1,9 @@
+describe('python3', function () {
+ it('can evaluate exactly the same tests as the python2 runner', function (done) {
+ require('fs').readFile('test/runners/python_spec.js', 'utf8', function (error, data) {
+ if (error) throw error;
+ eval(data.split('python').join('python3'));
+ done();
+ });
+ });
+});
diff --git a/test/runners/python_spec.js b/test/runners/python_spec.js
new file mode 100644
index 00000000..f4901f6d
--- /dev/null
+++ b/test/runners/python_spec.js
@@ -0,0 +1,148 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+describe('python runner', function () {
+
+ describe('.run', function () {
+ runner.assertCodeExamples('python');
+
+ it('should handle basic code evaluation', function (done) {
+ runner.run({language: 'python', code: 'import sys; sys.stdout.write("42")'}, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.equal('42');
+ done();
+ });
+ });
+ it('stderr', function (done) {
+ runner.run({language: 'python', code: 'import sys; sys.stderr.write("Error! Codewars cannot and will not accept any more Fibonacci kata.")'}, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stderr).to.equal("Error! Codewars cannot and will not accept any more Fibonacci kata.");
+ done();
+ });
+ });
+ it('stderr', function (done) {
+ runner.run({language: 'python', code: 'import sys; sys.stderr.write("florp"); sys.stdout.write("foop")'}, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stderr).to.equal("florp");
+ expect(buffer.stdout).to.equal("foop");
+ done();
+ });
+ });
+ });
+ describe('cw-2', function () {
+ it('should handle a basic assertion', function (done) {
+ runner.run({
+ language: 'python',
+ code: 'a = 1',
+ fixture: 'test.expect(a == 1)',
+ testFramework: 'cw-2'
+ },
+ function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.equal('Test Passed\n');
+ done();
+ });
+ });
+ it('should handle a basic assert_equals', function (done) {
+ runner.run({
+ language: 'python',
+ code: 'a = 1',
+ fixture: 'test.assert_equals(a, 1)',
+ testFramework: 'cw-2'
+ },
+ function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.equal('Test Passed\n');
+ done();
+ });
+ });
+ it('should handle a basic setup', function (done) {
+ runner.run({
+ language: 'python',
+ code: 'a = 1',
+ setup: 'b = 2',
+ fixture: 'test.assert_equals(b, 2)',
+ testFramework: 'cw-2'
+ },
+ function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.equal('Test Passed\n');
+ done();
+ });
+ });
+ it('should handle a failed assertion', function (done) {
+ runner.run({
+ language: 'python',
+ code: 'a = 1',
+ fixture: 'test.expect(a == 2)',
+ testFramework: 'cw-2'
+ },
+ function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.equal('Value is not what was expected\n');
+ done();
+ });
+ });
+
+ it('should handle a failed assertion', function (done) {
+ runner.run({language: 'python',
+ code: 'a.fail()',
+ testFramework: 'cw-2'},
+ function (buffer) {
+ console.log(buffer);
+ expect(buffer.stderr).to.not.contain('File ');
+ expect(buffer.stderr).to.not.contain(', line ');
+ expect(buffer.stderr).to.not.contain('most recent call last');
+ done();
+ });
+ });
+ });
+ describe('unittest', function () {
+ it('should handle a basic assertion', function (done) {
+ runner.run({language: 'python',
+ code: 'a = 1',
+ fixture: [
+ 'class Test(unittest.TestCase):',
+ ' def test_assert(self):',
+ ' self.assertEqual(a, 1)'
+ ].join('\n'),
+ testFramework: 'unittest'},
+ function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.equal('Test Passed\n');
+ done();
+ });
+ });
+ it('should handle a failed assetion', function (done) {
+ runner.run({language: 'python',
+ code: 'a = 1',
+ fixture: [
+ 'class Test(unittest.TestCase):',
+ ' def test_assert(self):',
+ ' self.assertEqual(a, 2, "test failed")'
+ ].join('\n'),
+ testFramework: 'unittest'},
+ function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain('');
+ expect(buffer.stdout).to.contain('test failed');
+ done();
+ });
+ });
+ it('should handle a failed assetion', function (done) {
+ runner.run({language: 'python',
+ code: 'a = 1',
+ fixture: [
+ 'class Test(unittest.TestCase):',
+ ' def test_assert(self):',
+ ' raise Exception("exceptions are my favorite, I always throw them")'
+ ].join('\n'),
+ testFramework: 'unittest'},
+ function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.equal('Unhandled Exception: exceptions are my favorite, I always throw them\n');
+ done();
+ });
+ });
+ });
+});
diff --git a/test/runners/r_spec.js b/test/runners/r_spec.js
new file mode 100644
index 00000000..f1faf601
--- /dev/null
+++ b/test/runners/r_spec.js
@@ -0,0 +1,14 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe( 'r runner', function(){
+ describe( '.run', function(){
+ it( 'should handle basic code evaluation', function(done){
+ runner.run({language: 'r', code: 'cat("What a pirate says?")'}, function(buffer) {
+ expect(buffer.stdout).to.equal('What a pirate says?');
+ done();
+ });
+ });
+ });
+});
\ No newline at end of file
diff --git a/test/runners/racket_spec.js b/test/runners/racket_spec.js
new file mode 100644
index 00000000..a4392936
--- /dev/null
+++ b/test/runners/racket_spec.js
@@ -0,0 +1,32 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe( 'racket runner', function(){
+ describe( '.run', function(){
+ it( 'should handle basic code evaluation', function(done){
+ runner.run({language: 'racket', code: '(print 42)'}, function(buffer) {
+ expect(buffer.stdout).to.equal('42');
+ done();
+ });
+ });
+
+ it('should handle setup code and imports', function (done) {
+ runner.run({
+ language: 'racket',
+ setup: [
+ '#lang racket/base',
+ '(provide twice)',
+ '(define (twice x) (+ x x))'
+ ].join('\n'),
+ code: [
+ "(print (twice 2))"
+ ].join('\n')
+ }, function (buffer) {
+ expect(buffer.stdout).to.equal('4');
+ done();
+ });
+ });
+
+ });
+});
diff --git a/test/runners/ruby_spec.js b/test/runners/ruby_spec.js
new file mode 100644
index 00000000..4fcddf84
--- /dev/null
+++ b/test/runners/ruby_spec.js
@@ -0,0 +1,203 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe('ruby runner', function () {
+ describe('.run', function () {
+ runner.assertCodeExamples('ruby');
+
+ it('should handle basic code evaluation', function (done) {
+ runner.run({language: 'ruby', code: 'puts 42'}, function (buffer) {
+ expect(buffer.stdout).to.equal('42\n');
+ done();
+ });
+ });
+
+ describe('cw-2', function () {
+ it('should handle a basic assertion', function (done) {
+ runner.run({language: 'ruby', code: 'a = 1', fixture: 'Test.expect a == 1', testFramework: 'cw-2'}, function (buffer) {
+ expect(buffer.stdout).to.equal('Test Passed\n');
+ done();
+ });
+ });
+
+ it('should handle a basic description', function (done) {
+ runner.run({language: 'ruby', code: 'a = 1', fixture: 'describe("test") { Test.expect a == 1 }', testFramework: 'cw-2'}, function (buffer) {
+ expect(buffer.stdout).to.contain('test\nTest Passed\n');
+ expect(buffer.stdout).to.contain('ms');
+ done();
+ });
+ });
+
+ describe('error handling', function () {
+ it('should handle a mix of failures and successes', function (done) {
+ runner.run({language: 'ruby',
+ code: 'a = 1',
+ fixture: 'describe "test" do\n' +
+ 'it("test1") { Test.expect(false) }\n' +
+ 'it("test2") { Test.expect(true) }\n' +
+ 'end',
+ testFramework: 'cw-2'}, function (buffer) {
+ console.log(buffer.stdout)
+ expect(buffer.stdout).to.contain('Value is not what was expected');
+ expect(buffer.stdout).to.contain('Test Passed');
+ done();
+ });
+ });
+ it('should gracefully handle custom errors', function (done) {
+ runner.run({language: 'ruby',
+ code: 'a = 1',
+ fixture: 'describe "test" do\n' +
+ 'it("test1") { raise "boom!" }\n' +
+ 'it("test2") { Test.expect(true)}\n' +
+ 'end',
+ testFramework: 'cw-2'}, function (buffer) {
+ expect(buffer.stdout).to.contain('');
+ expect(buffer.stdout).to.contain('boom!');
+ expect(buffer.stdout).to.contain('Test Passed');
+ done();
+ });
+ });
+ it('should gracefully handle reference errors', function (done) {
+ runner.run({language: 'ruby',
+ code: 'a = 1',
+ fixture: 'describe "test" do\n' +
+ 'it("test1") { a.idontexist() }\n' +
+ 'it("test2") { Test.expect(true)}\n' +
+ 'end',
+ testFramework: 'cw-2'}, function (buffer) {
+ expect(buffer.stdout).to.contain('');
+ expect(buffer.stdout).to.contain('<:LF:>');
+ expect(buffer.stdout).to.contain('NoMethodError:');
+ expect(buffer.stdout).to.not.contain('from /cli-runner/');
+ expect(buffer.stdout).to.not.contain('-e:');
+ expect(buffer.stdout).to.not.contain('cw-2.rb');
+ expect(buffer.stdout).to.contain('Test Passed');
+ done();
+ });
+ });
+
+ it('should prevent short circuiting', function (done) {
+ runner.run({language: 'ruby',
+ code: [
+ "def example",
+ " Test.expect(true);",
+ " raise 'early error'",
+ "end"
+ ].join("\n"),
+ fixture: [
+ 'describe "test" do',
+ ' it("test1") { example }',
+ ' it("test2") { Test.expect(false)}',
+ 'end'
+ ].join('\n'),
+ testFramework: 'cw-2'}, function (buffer) {
+ expect(buffer.stdout).to.contain('');
+ done();
+ }
+ );
+ });
+ });
+ });
+ describe('rspec', function () {
+ it('should handle a basic assertion', function (done) {
+ runner.run({language: 'ruby',
+ code: 'a = 1',
+ fixture: 'describe "test" do\n' +
+ 'it("test2") { expect(1).to eq(1)}\n' +
+ 'end',
+ testFramework: 'rspec'}, function (buffer) {
+ expect(buffer.stdout).to.equal('test\ntest2\nTest Passed\n\n');
+ done();
+ }
+ );
+ });
+ it('should support let', function (done) {
+ runner.run({language: 'ruby',
+ code: 'a = 1',
+ fixture: ['describe "test" do',
+ 'let(:b) { a }',
+ 'it("test2") { expect(b).to eq(1)}',
+ 'end'].join('\n'),
+ testFramework: 'rspec'}, function (buffer) {
+ expect(buffer.stdout).to.equal('test\ntest2\nTest Passed\n\n');
+ done();
+ }
+ );
+ });
+ it('should handle a basic failed assertion', function (done) {
+ runner.run({language: 'ruby',
+ code: 'a = 1',
+ fixture: 'describe "test" do\n' +
+ 'it("test2") { expect(1).to eq(2)}\n' +
+ 'end',
+ testFramework: 'rspec'}, function (buffer) {
+ expect(buffer.stdout).to.contain('test\ntest2');
+ expect(buffer.stdout).to.contain('');
+ expect(buffer.stdout).to.not.contain('');
+ expect(buffer.stdout).to.not.contain('simplified backtrace');
+ done();
+ }
+ );
+ });
+ it('should handle errored code', function (done) {
+ runner.run({language: 'ruby',
+ code: 'a = 1',
+ fixture: 'describe "test" do\n' +
+ 'it("test1") { a.idontexist() }\n' +
+ 'it("test2") { expect(true)}\n' +
+ 'end',
+ testFramework: 'rspec'}, function (buffer) {
+ expect(buffer.stdout).to.contain('test');
+ expect(buffer.stdout).to.contain('test1');
+ expect(buffer.stdout).to.contain('test2');
+ expect(buffer.stdout).to.contain('');
+ done();
+ }
+ );
+ });
+ it('should prevent short circuiting', function (done) {
+ runner.run({language: 'ruby',
+ code: [
+ "def example",
+ " expect(true);",
+ " raise 'early error'",
+ "end"
+ ].join("\n"),
+ fixture: [
+ 'describe "test" do',
+ ' it("test1") { example }',
+ ' it("test2") { expect(false)}',
+ 'end'
+ ].join('\n'),
+ testFramework: 'rspec'}, function (buffer) {
+ expect(buffer.stdout).to.contain('');
+ done();
+ }
+ );
+ });
+ });
+ describe('potpourri', function () {
+ it('can run redis', function (done) {
+ runner.run({
+ language: 'ruby',
+ code: [
+ 'fork do',
+ ' exec "redis-server"',
+ 'end',
+ "require 'redis'",
+ 'r = Redis.new',
+ "r.set('a', 'b')"
+ ].join('\n'),
+ fixture: "Test.assert_equals(r.get('a'), 'b')",
+ testFramework: 'cw-2'
+ }, function (buffer) {
+ console.log(buffer.stderr);
+ expect(buffer.stdout).to.contain('Test Passed: Value == \"b\"');
+ done();
+ });
+ });
+ });
+ });
+
+});
diff --git a/test/runners/scala_spec.js b/test/runners/scala_spec.js
new file mode 100644
index 00000000..e9eedd52
--- /dev/null
+++ b/test/runners/scala_spec.js
@@ -0,0 +1,48 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+describe('scala runner', function () {
+ describe('.run', function () {
+ it('should handle basic code evaluation', function (done) {
+ var code = [
+ 'object HelloWorld {',
+ 'def main(args: Array[String]) {',
+ 'println("Hello, world!")',
+ '}',
+ '}'
+ ].join('\n');
+
+ runner.run({language: 'scala', code: code}, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.equal("Hello, world!\n");
+ done();
+ });
+ });
+ it('should handle setup code and imports', function (done) {
+ runner.run({
+ language: 'scala',
+ setup: [
+ 'package problems',
+ 'object Lists {',
+ 'def last(list: List[Any]): Option[Any] = list match {',
+ 'case Nil => None',
+ 'case x :: Nil => Some(x)',
+ 'case _ :: xs => last(xs)',
+ '}',
+ '}'
+ ].join('\n'),
+ code: [
+ 'import problems.Lists._',
+ 'object Test extends App {',
+ ' println("Starting tests...")',
+ ' println(last(List(1,2,3,4,5)))',
+ '}'
+ ].join('\n')
+ }, function (buffer) {
+ expect(buffer.stdout).to.contain('Starting tests...');
+ expect(buffer.stdout).to.contain('5');
+ done();
+ });
+ });
+ });
+});
diff --git a/test/runners/swift_spec.js b/test/runners/swift_spec.js
new file mode 100644
index 00000000..ad904043
--- /dev/null
+++ b/test/runners/swift_spec.js
@@ -0,0 +1,103 @@
+if (process.platform == 'darwin') {
+ var expect = require('chai').expect;
+ var runner = require('../runner');
+
+
+ describe('swift runner', function () {
+ describe('.run', function () {
+ it('should handle basic code evaluation', function (done) {
+ runner.run({
+ language: 'swift',
+ code: "println(\"You've baked a really lovely cake, but then you've used dog shit for frosting. - Steve Jobs (commenting on an employee's program)\")"
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.equal("You've baked a really lovely cake, but then you've used dog shit for frosting. - Steve Jobs (commenting on an employee's program)\n");
+ done();
+ });
+ });
+ it('should handle setup code', function (done) {
+ runner.run({
+ language: 'swift',
+ setup: "func foo() -> Int { return 999; }",
+ code: "println(foo())"
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.equal("999\n");
+ done();
+ });
+ });
+ it('should handle a full test', function (done) {
+ runner.run({
+ language: 'swift',
+ code: [
+ '// payload1.swift',
+ 'func foo() -> Int { return 999; }'
+ ].join('\n'),
+ fixture: [
+ '// fixture1.swift',
+ 'import XCTest',
+ 'class runner_test: XCTestCase {',
+ ' func testExample() {',
+ ' XCTAssert(foo() == 998 , "badbadbad")',
+ ' }',
+ '}'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain("badbadbad");
+ done();
+ });
+ });
+ it('should handle a broken test', function (done) {
+ runner.run({
+ language: 'swift',
+ code: [
+ '// payload2.swift',
+ 'func foo() ->'
+ ].join('\n'),
+ fixture: [
+ '// fixture2.swift',
+ 'import XCTest',
+ 'class runner_test: XCTestCase {',
+ ' func testExample() {',
+ ' XCTAssert(foo() == 998 , "badbadbad")',
+ ' }',
+ '}'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain("payload2.swift:2:14: error: expected type for function result");
+ done();
+ });
+ });
+
+ it('should handle a full with setup', function (done) {
+ runner.run({
+ language: 'swift',
+ setup: [
+ '// bar.swift',
+ 'func bar() -> Int { return 999; }'
+ ].join('\n'),
+ code: [
+ '// payload3.swift',
+ 'func foo() -> Int { return bar(); }'
+ ].join('\n'),
+ fixture: [
+ '// fixture3.swift',
+ 'import XCTest',
+ 'class setup_test: XCTestCase {',
+ ' func testFooBar() {',
+ ' XCTAssert(foo() == 999 , "badbadbad")',
+ ' }',
+ '}'
+ ].join('\n')
+ }, function (buffer) {
+ console.log(buffer);
+ expect(buffer.stdout).to.contain("Test Case '-[setup_test testFooBar]' passed");
+ done();
+ });
+ });
+
+ });
+ });
+}
diff --git a/test/runners/typescript_spec.js b/test/runners/typescript_spec.js
new file mode 100644
index 00000000..7150ada2
--- /dev/null
+++ b/test/runners/typescript_spec.js
@@ -0,0 +1,50 @@
+var expect = require('chai').expect;
+var runner = require('../runner');
+
+
+describe( 'typescript runner', function(){
+ //describe( '.run', function(){
+ // it( 'should handle basic code evaluation', function(done){
+ // runner.run({language: 'typescript', code: 'console.log(42)'}, function(buffer) {
+ // expect(buffer.stdout).to.equal('42\n');
+ // done();
+ // });
+ // });
+ //});
+
+ describe('mocha bdd', function() {
+ it( 'should handle outputting objects', function(done){
+ runner.run({
+ language: 'typescript',
+ code: 'interface B { b:number }; var a:B = {b: 3};exports.a = a;',
+ fixture: 'var assert = require("chai").assert;describe("test", function(){it("should be 3", function(){assert.equal(3, solution.a.b);})});',
+ testFramework: 'mocha_bdd'},
+ function(buffer) {
+ expect(buffer.stdout).to.contain('');
+ done();
+ });
+ });
+ it( 'should handle failures', function(done){
+ runner.run({
+ language: 'typescript',
+ code: 'exports.a = {b: 2};',
+ fixture: 'var assert = require("chai").assert;describe("test", function(){describe("failures", function(){it("should be 1", function(){assert.equal(1, solution.a.b);})})});',
+ testFramework: 'mocha_bdd'},
+ function(buffer) {
+ expect(buffer.stdout).to.contain('');
+ done();
+ });
+ });
+ it( 'should handle errors', function(done){
+ runner.run({
+ language: 'typescript',
+ code: 'exports.a = {b: 2};',
+ fixture: 'describe("test", function(){describe("failures", function(){it("should be 1", function(){throw new Error("test error");})})});',
+ testFramework: 'mocha_bdd'},
+ function(buffer) {
+ expect(buffer.stdout).to.contain('');
+ done();
+ });
+ });
+ });
+});
diff --git a/test_cs.sh b/test_cs.sh
new file mode 100644
index 00000000..41f46535
--- /dev/null
+++ b/test_cs.sh
@@ -0,0 +1,11 @@
+mv -f ../../NUnit-codewars/bin/Debug/nunit.framework.dll frameworks/csharp/nunit/nunit.framework.dll
+mv -f ../../NUnit-codewars/bin/Debug/nunit.util.dll frameworks/csharp/nunit/nunit.util.dll
+mv -f ../../NUnit-codewars/bin/Debug/nunit.core.dll frameworks/csharp/nunit/nunit.core.dll
+mv -f ../../NUnit-codewars/bin/Debug/nunit.core.interfaces.dll frameworks/csharp/nunit/nunit.core.interfaces.dll
+mv -f ../../NUnit-codewars/bin/Debug/nunit-console.exe frameworks/csharp/nunit/nunit-console.exe
+mv -f ../../NUnit-codewars/bin/Debug/nunit-console.exe.config frameworks/csharp/nunit/nunit-console.exe.config
+mv -f ../../NUnit-codewars/bin/Debug/log4net.dll frameworks/csharp/nunit/log4net.dll
+cp -r ../../NUnit-codewars/bin/Debug/framework/* frameworks/csharp/nunit/framework
+cp -r ../../NUnit-codewars/bin/Debug/lib/* frameworks/csharp/nunit/lib
+
+mocha test/runners/csharp_spec
diff --git a/typings.json b/typings.json
new file mode 100644
index 00000000..0baa5323
--- /dev/null
+++ b/typings.json
@@ -0,0 +1,14 @@
+{
+ "ambientDependencies": {
+ "baconjs": "registry:dt/baconjs#0.7.0+20160209151603",
+ "chai": "registry:dt/chai#3.4.0+20160216071402",
+ "lodash": "registry:dt/lodash#3.10.0+20160308151359",
+ "mocha": "registry:dt/mocha#2.2.5+20151023103246",
+ "mocha-node": "registry:dt/mocha-node#2.2.5+20150623123832",
+ "mongoose": "registry:dt/mongoose#3.8.5+20160209123716",
+ "node": "registry:dt/node#4.0.0+20160226132328",
+ "react": "registry:dt/react#0.14.0+20160302224448",
+ "redis": "registry:dt/redis#0.12.1+20160303114034",
+ "rx": "registry:dt/rx#2.5.3+20150720134954"
+ }
+}
diff --git a/typings/browser.d.ts b/typings/browser.d.ts
new file mode 100644
index 00000000..8fdf7e20
--- /dev/null
+++ b/typings/browser.d.ts
@@ -0,0 +1,10 @@
+///
+///
+///
+///
+///
+///
+///
+///
+///
+///
diff --git a/typings/browser/ambient/baconjs/index.d.ts b/typings/browser/ambient/baconjs/index.d.ts
new file mode 100644
index 00000000..13d19349
--- /dev/null
+++ b/typings/browser/ambient/baconjs/index.d.ts
@@ -0,0 +1,3132 @@
+// Generated by typings
+// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/9027703c0bd831319dcdf7f3169f7a468537f448/baconjs/baconjs.d.ts
+// Type definitions for Bacon.js 0.7.0
+// Project: https://baconjs.github.io/
+// Definitions by: Alexander Matsievsky
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+
+interface JQuery {
+ /**
+ * @method
+ * @description Creates an [EventStream]{@link Bacon.EventStream} from events on a jQuery or Zepto.js object.
+ * @param {string} eventName
+ * @returns {EventStream}
+ * @example
+ * $("#my-div").asEventStream("click");
+ */
+ asEventStream(eventName:string):Bacon.EventStream;
+
+ /**
+ * @method
+ * @description Creates an [EventStream]{@link Bacon.EventStream} from events on a jQuery or Zepto.js object. You can pass an argument to add a jQuery live `selector`.
+ * @param {string} eventName
+ * @param {string} selector
+ * @returns {EventStream}
+ * @example
+ * $("#my-div").asEventStream("click", ".more-specific-selector");
+ */
+ asEventStream(eventName:string, selector:string):Bacon.EventStream;
+
+ /**
+ * @callback JQuery#asEventStream1~f
+ * @param {JQueryEventObject} event
+ * @param {*[]} args
+ * @returns {A}
+ */
+ /**
+ * @method JQuery#asEventStream1
+ * @description Creates an [EventStream]{@link Bacon.EventStream} from events on a jQuery or Zepto.js object. You can pass an argument to add a function `f` that processes the jQuery event and its parameters.
+ * @param {string} eventName
+ * @param {JQuery#asEventStream1~f} f
+ * @returns {EventStream}
+ * @example
+ * $("#my-div").asEventStream("click", (event, args) => args[0]);
+ */
+ asEventStream(eventName:string, f:(event:JQueryEventObject, args:any[]) => A):Bacon.EventStream;
+
+ /**
+ * @callback JQuery#asEventStream2~f
+ * @param {JQueryEventObject} event
+ * @param {*[]} args
+ * @returns {A}
+ */
+ /**
+ * @method JQuery#asEventStream2
+ * @description Creates an [EventStream]{@link Bacon.EventStream} from events on a jQuery or Zepto.js object. You can pass an argument to add a jQuery live `selector` and a function `f` that processes the jQuery event and its parameters.
+ * @param {string} eventName
+ * @param {string} selector
+ * @param {JQuery#asEventStream2~f} f
+ * @returns {Bacon.EventStream}
+ * @example
+ * $("#my-div").asEventStream("click", ".more-specific-selector", (event, args) => args[0]);
+ */
+ asEventStream(eventName:string, selector:string, f:(event:JQueryEventObject, args:any[]) => A):Bacon.EventStream;
+}
+
+/** @module Bacon */
+declare module Bacon {
+ /**
+ * @function
+ * @description Creates an [EventStream]{@link Bacon.EventStream} from a `promise` Promise object such as JQuery Ajax. This stream will contain a single value or an error, followed immediately by stream end. You can use the optional `abort` flag (i.e. ´Bacon.fromPromise(p, true)´ to have the `abort` method of the given promise be called when all subscribers have been removed from the created stream.
+ * @param {Promise|JQueryXHR} promise
+ * @param {boolean} [abort]
+ * @returns {EventStream}
+ * @example
+ * Bacon.fromPromise($.ajax("https://baconjs.github.io/"));
+ * Bacon.fromPromise(Promise.resolve(1));
+ * Bacon.fromPromise($.ajax("https://baconjs.github.io/"), true);
+ * Bacon.fromPromise(Promise.resolve(1), false);
+ */
+ function fromPromise(promise:Promise|JQueryXHR, abort?:boolean):EventStream;
+
+ /**
+ * @callback Bacon.fromPromise~eventTransformer
+ * @param {A} value
+ * @returns {(Initial|Next|End|Error)[]}
+ */
+ /**
+ * @function Bacon.fromPromise
+ * @description Creates an [EventStream]{@link Bacon.EventStream} from a `promise` Promise object such as JQuery Ajax. This stream will contain a single value or an error, followed immediately by stream end. You can use the `abort` flag (i.e. ´Bacon.fromPromise(p, true)´ to have the `abort` method of the given promise be called when all subscribers have been removed from the created stream, and also pass a function `eventTransformer` that transforms the promise value into Events. The default is to transform the value into `[new Bacon.Next(value), new Bacon.End()]`.
+ * @param {Promise|JQueryXHR} promise
+ * @param {boolean} abort
+ * @param {Bacon.fromPromise~eventTransformer} eventTransformer
+ * @returns {EventStream}
+ * @example
+ * Bacon.fromPromise($.ajax("https://baconjs.github.io/"), true, (n:string) => {
+ * return [new Bacon.Next(n), new Bacon.Next(() => n), new Bacon.End()];
+ * });
+ * Bacon.fromPromise(Promise.resolve(1), false, n => {
+ * return [new Bacon.Next(n), new Bacon.Next(() => n), new Bacon.End()];
+ * });
+ */
+ function fromPromise(promise:Promise|JQueryXHR, abort:boolean, eventTransformer:(value:A) => (Initial|Next|End|Error)[]):EventStream;
+
+ /**
+ * @function
+ * @description Creates an [EventStream]{@link Bacon.EventStream} from events on a DOM EventTarget or Node.JS EventEmitter object, or an object that supports event listeners using `on`/`off` methods.
+ * @param {EventTarget|NodeJS.EventEmitter|JQuery} target
+ * @param {string} eventName
+ * @returns {EventStream}
+ * @example
+ * Bacon.fromEvent(document.body, "click").onValue(() => {
+ * alert("Bacon!");
+ * });
+ * Bacon.fromEvent(process.stdin, "readable", () => {
+ * alert("Bacon!");
+ * });
+ * Bacon.fromEvent($("body"), "click").onValue(() => {
+ * alert("Bacon!");
+ * });
+ */
+ function fromEvent(target:EventTarget|NodeJS.EventEmitter|JQuery, eventName:string):EventStream;
+
+ /**
+ * @callback Bacon.fromEvent~eventTransformer
+ * @param {A} event
+ * @returns {B}
+ */
+ /**
+ * @function Bacon.fromEvent
+ * @description Creates an [EventStream]{@link Bacon.EventStream} from events on a DOM EventTarget or Node.JS EventEmitter object, or an object that supports event listeners using `on`/`off` methods. You can pass a function `eventTransformer` that transforms the emitted events' parameters.
+ * @param {EventTarget|NodeJS.EventEmitter|JQuery} target
+ * @param {string} eventName
+ * @param {Bacon.fromEvent~eventTransformer} eventTransformer
+ * @returns {EventStream}
+ * @example
+ * Bacon.fromEvent(document.body, "click", (event:MouseEvent) => event.clientX).onValue(clientX => {
+ * alert("Bacon!");
+ * });
+ */
+ function fromEvent(target:EventTarget|NodeJS.EventEmitter|JQuery, eventName:string, eventTransformer:(event:A) => B):EventStream;
+
+ /**
+ * @callback Bacon.fromCallback1~f
+ * @param {Bacon.fromCallback1~callback} callback
+ * @returns {void}
+ */
+ /**
+ * @callback Bacon.fromCallback1~callback
+ * @param {...*} args
+ * @returns {void}
+ */
+ /**
+ * @function Bacon.fromCallback1
+ * @description Creates an [EventStream]{@link Bacon.EventStream} from a function `f` that accepts a `callback`. The function is supposed to call its callback just once.
+ * @param {Bacon.fromCallback1~f} f
+ * @returns {EventStream}
+ * @example
+ * // This would create a stream that outputs a single value "Bacon!" and ends after that. The use of setTimeout causes the value to be delayed by 1 second.
+ * Bacon.fromCallback(callback => {
+ * setTimeout(() => {
+ * callback("Bacon!");
+ * }, 1000);
+ * });
+ */
+ function fromCallback(f:(callback:(...args:any[]) => void) => void):EventStream;
+
+ /**
+ * @callback Bacon.fromCallback2~f
+ * @param {...*} args
+ * @returns {void}
+ */
+ /**
+ * @function Bacon.fromCallback2
+ * @description Creates an [EventStream]{@link Bacon.EventStream} from a function `f` that accepts a `callback`. The function is supposed to call its callback just once.
+ * @param {Bacon.fromCallback2~f} f
+ * @param {...*} args
+ * @returns {EventStream}
+ * @example
+ * // You can also give any number of arguments to `fromCallback`, which will be passed to the function. These arguments can be simple variables, Bacon EventStreams or Properties. For example the following will output "Bacon rules":
+ * Bacon.fromCallback((a, b, callback) => {
+ * callback(a + " " + b);
+ * }, Bacon.constant("bacon"), "rules").log();
+ */
+ function fromCallback(f:(...args:any[]) => void, ...args:any[]):EventStream;
+
+ /**
+ * @function
+ * @description Creates an [EventStream]{@link Bacon.EventStream} from a `methodName` method of a given `object`. The function is supposed to call its callback just once.
+ * @param {Object} object
+ * @param {string} methodName
+ * @param {...*} args
+ * @returns {EventStream}
+ */
+ function fromCallback(object:Object, methodName:string, ...args:any[]):EventStream;
+
+ /**
+ * @callback Bacon.fromNodeCallback~f
+ * @param {Bacon.fromNodeCallback~callback} callback
+ * @returns {void}
+ */
+ /**
+ * @callback Bacon.fromNodeCallback~callback
+ * @param {E} error
+ * @param {A} data
+ * @returns {void}
+ */
+ /**
+ * @function Bacon.fromNodeCallback
+ * @description Creates an [EventStream]{@link Bacon.EventStream} from a function `f` that accepts a Node.js `callback`: callback(error, data), where error is `null` if everything is fine. The function is supposed to call its callback just once.
+ * @param {Bacon.fromNodeCallback~f} f
+ * @param {...*} args
+ * @returns {EventStream}
+ * @example
+ * {
+ * let fs = require("fs"),
+ * read = Bacon.fromNodeCallback(fs.readFile, "input.txt");
+ * read.onError(error => {
+ * console.log("Reading failed: " + error);
+ * });
+ * read.onValue(value => {
+ * console.log("Read contents: " + value);
+ * });
+ * }
+ */
+ function fromNodeCallback(f:(callback:(error:E, data:A) => void) => void, ...args:any[]):EventStream