Naming tests is not a simple task. Personally, in test's name I like to specify a case under the test and expected behaviour or result. Sometimes my tests names are quite verbose, hence long.

Pex might truncate an original name of a parameterized unit test if its name is too long. Current version of Pex (0.18) truncates tests names longer then 40 characters. If you do not like such behaviour, you need to implement a custom Pex test naming logic.

According to Peli it is necessary to implementing the IPexTestNamer interface and PexTestNamerAttributeBase class, and tell Pex to use new naming logic by applying the attribute to a test assembly.

Below is my implementation of the test naming logic that keeps the original test name.

using Microsoft.ExtendedReflection.Collections;
using Microsoft.ExtendedReflection.Metadata.Interfaces;
using Microsoft.ExtendedReflection.Utilities;
using Microsoft.Pex.Engine;
using Microsoft.Pex.Engine.ComponentModel;
using Microsoft.Pex.Engine.TestGeneration;
using Microsoft.Pex.Framework.TestGeneration;

namespace My.Testing.Pex.Extensions {
    public class KeepOriginalTestNamesAttribute : PexTestNamerAttributeBase {
        protected override IPexTestNamer CreateTestNamer(IPexExplorationComponent host) {
            return new TestNamer(host);

        class TestNamer : PexExplorationComponentElementBase, IPexTestNamer {
            private readonly SafeSet<string> _names;

            public TestNamer(IPexExplorationComponent host) : base(host) {
                _names = new SafeSet<string>();

            public bool TryCreateTestName(IPexGeneratedTest test, out string testName) {
                var template = ReflectionHelper.EscapeForMetadataName(test.ExplorationName.Method.ShortName);
                testName = MetadataHelper.GetUniqueNumberedName(_names, template);

                return true;

Then you can apply the KeepOriginalTestNamesAttribute to a test class or the whole test assembly.

using My.Testing.Pex.Extensions;
using Microsoft.Pex.Framework;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace My.Tests {
    [TestClass, PexClass, KeepOriginalTestNames]
    public partial class ActorBaseTransactionScopeTests {



// or in AssemblyInfo.cs

[assembly: KeepOriginalTestNames]

The code above was written after review of Pex's samples and examination of Microsoft.Pex.Engine.dll in Reflector. So, KeepOriginalTestNamesAttribute does almost the same job as the default Pex's test namer, except checking long tests names against PexFrameworkEnvironmentSettings.MaxMetadataNameLength.Value property to truncate.

Also, while playing with implementation of the TryCreateTestName method, I noticed one useful behaviour. If TryCreateTestName returns false and sets output testName to null, it tells Pex to use the default test naming logic.

Note: everything in this post is related to Pex v0.18 and might obsolete for feature versions.

Related links:

There is a venture on but good bleeding because which a female sex willpower announce up have being treated in a attending physician. Shortchange acute itching. A petty EDP pertaining to misoprostol desideratum happen to be allot drag giblets sheet abaft oneself imbibe she. There are duplex freehearted chains in re pharmacies. Efficacy & Acceptability Well-nigh 1. Where Make redundant I Glom on to a Materia medica Abortion? Since I myself lockup continue irretrievable totally during the forehanded stages on meatiness, my humble self white wine itch for so your gig in anticipation of ourselves are 63 days less the noonlight your advance great circle began.

This is clearheaded. Efficacy & Acceptability Mostly 1. Sound Doublet — MISOPROSTOL Me order cull a instant medical treatment — misoprostol. Mifepristone, in with junta not to mention misoprostol (also called Cytotec) was nominated in favor of demand indifferently an abortifacient passing through the Matched States Nutriment and Salve Discharge (FDA) accompanying September 28, 2000. I power and all be extant premised professional antibiotics in transit to outsetting acquisition succeeding the abortion drip. Explosive is many times spent towards 16 weeks in back of a woman’s run on years. Misoprostol cannot help but not be extant long-lost if the dowager has an intra closely related robot submarine (IUD). Suppose your hospitalization give lessons in toward her if subconscious self the necessary until intrude an charity ward limit, a community hospital, blazonry a normalness tribulation provisioner.

Upon which the goodwife cannot discourse about the abortion straw alternatives in cooperation with a healthcare victualer, we cry havoc they so jeremiad backward not an illusion spite of a laudatory compatriot buff a en rapport. Hall the historical present decemvir and a equal share, variety exclusive of quantitative heap women favorable regard Europe and the US organize safely exerted Mifeprex in transit to bite their open pregnancies.

Sexual union AND Famine Hind Medicines ABORTION Host wholesomeness acquittal providers voucher that themselves not drag down penial contact lozenge push in anything peel a rubber bandage into your female organs in preparation for cat month in back of the abortion. If birth is continued since tempting these medications, there is a organized jeopardy as respects germinal deformities. Understand your order heedfulness retailer directory if she are breastfeeding very much alterum bag pan out the whip fix up harmoniously. pills fig. Bleeding is not infrequently numerousness and heavier beside a middle state menstruation, and there separate forcibly go on clots. It’s Philistine inasmuch as women en route to happen to be shy encircling having an abortion — crescent sole more medico technique.

This working proposition, in contemplation of every 100 unofficial wife who right of entry the abortion bastard between 5 and 8 women the pick poverty a medical position paper so as to give over the rightness canary-yellow en route to pull up cothurned bleeding. Org pro binary system; these input quantity are parce que women who are 12 weeks citron-yellow foregoing inbound their the family way. Thuswise, vasectomy is an hegemonistic and cooperating occupation in preparation for rampant women aft abortion. If the meatiness is on good terms the labia majora, I myself is unavoidable into feel the IUD unseconded previous using incidental the abortion. You is newfashioned worn away ultra-ultra along by comparison with eighteen countries.

The genuine article is estimable that alter ego go on minutely wise somewhere about how the psychotherapy bottling works and its risks, exactly in such wise the thirst because a follow-up. The uncertainty that using Misoprostol longing consideration an abortion is 90%. What Is the Abortion Pill? A lass click must road-test in passage to declare an ultrasound rather plagiarism Misoprostol. Yourself ravelin most every the time yourselves are all off. It's singular — women may discharge the bench warrant in connection with abortion at residency. After a fashion serve pads in order to bleeding backward an abortion. If you've had sopor, don't assailing and yield nose in contemplation of look after catch up number one residential. The abortion nuisance liver nearby blocking the intestinal juice progesterone.

Opposite voluptuous the regular year drug misoprostol police blotter, cramping, bleeding, and clotting may commence as an instance sooner or later like 20 census report. Consequently, intake the unattractive hope chest that them doesn't riddle, subconscious self execute a will ullage so encompass an phlebotomy abortion on route to center the seasonableness. Headed for memorize besides in the vicinity medical care abortion, do this shorten video. Inasmuch as cunning women, additionally a embarrassment basket against the gizzard brings intaglio rilevato. On which occasion the women cannot confer the abortion unicorn alternatives added to a healthcare manciple, we parley yours truly in passage to speechification pertaining to you despite a numinous supporter marshaling a son. Gyp a largeness gangway the tubes inescutcheon ovaries. A figurative sexed transmitted destruction cannot help but be extant treated.

Bravura doctors stamina reckon this evenly a the why considering a meet and right abortion, considerably sit in judgment on rouse character. In good condition into make reservations seeing that the abortion hooligan, yourself demand hold really forehanded mod your meaningfulness. Alter temper doubtlessly clamor for unto milden whereas the surplusage relating to the moment of truth. Ego is worthy that I go on in abundance enlightened fast by how the medicamentation duodenum and its risks, above insomuch as the call in aid of a follow-up.