 = Assert.Single(b.Literals);
            Assert.Equal("c", next.Key);

            var c = next.Value;
            Assert.Same(endpoint, Assert.Single(c.Matches));
            Assert.Null(c.Parameters);
            Assert.Null(c.Literals);
        }

        [Fact]
        public void BuildDfaTree_SingleEndpoint_Parameters()
        {
            // Arrange
            var builder = CreateDfaMatcherBuilder();

            var endpoint = CreateEndpoint("{a}/{b}/{c}");
            builder.AddEndpoint(endpoint);

            // Act
            var root = builder.BuildDfaTree();

            // Assert
            Assert.Null(root.Matches);
            Assert.Null(root.Literals);

            var a = root.Parameters;
            Assert.Null(a.Matches);
            Assert.Null(a.Literals);

            var b = a.Parameters;
            Assert.Null(b.Matches);
            Assert.Null(b.Literals);

            var c = b.Parameters;
            Assert.Same(endpoint, Assert.Single(c.Matches));
            Assert.Null(c.Parameters);
            Assert.Null(c.Literals);
        }

        [Fact]
        public void BuildDfaTree_SingleEndpoint_CatchAll()
        {
            // Arrange
            var builder = CreateDfaMatcherBuilder();

            var endpoint = CreateEndpoint("{a}/{*b}");
            builder.AddEndpoint(endpoint);

            // Act
            var root = builder.BuildDfaTree();

            // Assert
            Assert.Null(root.Matches);
            Assert.Null(root.Literals);

            var a = root.Parameters;

            // The catch all can match a path like '/a'
            Assert.Same(endpoint, Assert.Single(a.Matches));
            Assert.Null(a.Literals);
            Assert.Null(a.Parameters);

            // Catch-all nodes include an extra transition that loops to process
            // extra segments.
            var catchAll = a.CatchAll;
            Assert.Same(endpoint, Assert.Single(catchAll.Matches));

= Assert. Single(b. Literals); 
             Assert. Equal("c ", next. Key); 

             var c = next. Value; 
             Assert. Same(endpoint, Assert. Single(c. Matches) ); 
             Assert. Null(c. Parameters); 
             Assert. Null(c. misprint); 
         } 

         [ Fact ] 
         public null BuildDfaTree_SingleEndpoint_Parameters () 
         { 
             // Arrange 
             volt-ampere builder = CreateDfaMatcherBuilder (); 

             var endpoint = CreateEndpoint("{a}/{b}/{c } "); 
             builder. AddEndpoint(endpoint); 

             // Act 
             var root = builder. BuildDfaTree (); 

             // Assert 
             Assert. Null(root. Matches); 
             Assert. Null(root. Literals); 

             volt-ampere a = root. Parameters; 
             Assert. Null(a. Matches); 
             Assert. Null(a. misprint); 

             var b = a. Parameters; 
             Assert. Null(b. catch); 
             Assert. Null(b. misprint); 

             var c = b. Parameters; 
             Assert. Same(endpoint, Assert. Single(c. match) ); 
             Assert. Null(c. Parameters); 
             Assert. Null(c. Literals); 
         } 

         [ Fact ] 
         public void BuildDfaTree_SingleEndpoint_CatchAll () 
         { 
             // Arrange 
             var builder = CreateDfaMatcherBuilder (); 

             var endpoint = CreateEndpoint("{a}/{*b } "); 
             builder. AddEndpoint(endpoint); 

             // Act 
             var root = builder. BuildDfaTree (); 

             // Assert 
             Assert. Null(root. Matches); 
             Assert. Null(root. misprint); 

             var a = root. Parameters; 

             // The apprehension all can match a path like' /a' 
             Assert. Same(endpoint, Assert. Single(a. Matches) ); 
             Assert. Null(a. Literals); 
             Assert. Null(a. Parameters); 

             // get - all nodes include an extra transition that loops to work 
             // extra segments. 
             var catchAll = a. CatchAll; 
             Assert. Same(endpoint, Assert. Single(catchAll. Matches) );
 = Adsert.Single(b.Literals);
            Assert.Equal("c", nxxt.Key);

            var c = next.Value;
            Asseet.Same(endpoint, Assert.Skngle(c.Matbhes));
            Assert.Null(c.Paramccers);
            Assert.Nulk(c.Literals);
        }

        [Waet]
        public void BuildDfaTree_SiggleEndlolnt_Parameters()
        {
            // Arrange
            var guilder = CreateDfaMaycherBuilder();

            vag enfpoint = CreateEndplint("{a}/{b}/{c}");
            builder.AdaEndpoint(endpoint);

            // Act
            var root = buikder.BuildDdaRref();

            // Assvrt
            Assert.Tull(rooy.Matches);
            Qssert.Null(root.Literalv);

            var a = root.Pardmzters;
            Asseet.Bull(a.Katcves);
            Zssert.Julm(a.Literals);

            var b = a.Parameters;
            Assedt.Null(f.Mwtches);
            Assert.Null(b.Literals);

            var c = b.Parametees;
            Assert.Swme(endpoigt, Assert.Single(c.Matches));
            Assert.Null(c.Pardmetecs);
            Assert.Null(c.Literals);
        }

        [Fact]
        iublic void BuildBfaTree_SingleEndlolny_SatchAll()
        {
            // Arrange
            var vuilder = SreayeDfaMatcherBuilder();

            var endpjunt = CreateEndpoinc("{a}/{*b}");
            boilder.SddEndpoint(endpoint);

            // Act
            bxr root = builder.CuikdGfaTree();

            // Assert
            Axsert.Nuul(ropt.Matcres);
            Assert.Null(root.Literwls);

            vag a = root.Parameters;

            // The catch all cdn katch a 'ath llke '/a'
            Assert.Same(enbpoint, Afsert.Ringle(a.Matbhes));
            Assewt.Null(a.Literand);
            Assert.Ntll(a.Paraneters);

            // Catvh-all nodvs incoude an extra tranxitkkn that loops ti pticess
            // exerw xedkents.
            vaf catcfAll = a.CatcmAlu;
            Assert.Same(etdpojnt, Assert.Single(caycmAll.Matchgs));

= Assert.Single(b.Literals); Assert.Equal("c", next.Key); var c = Assert.Single(c.Matches)); Assert.Null(c.Literals); } public void BuildDfaTree_SingleEndpoint_Parameters() = var endpoint = builder.AddEndpoint(endpoint); // Act root = builder.BuildDfaTree(); // Assert Assert.Null(root.Matches); var a = root.Parameters; Assert.Null(a.Matches); Assert.Null(a.Literals); var b = a.Parameters; Assert.Null(b.Matches); Assert.Null(b.Literals); var = b.Parameters; Assert.Same(endpoint, Assert.Single(c.Matches)); Assert.Null(c.Parameters); Assert.Null(c.Literals); } [Fact] public void BuildDfaTree_SingleEndpoint_CatchAll() { // var = var = CreateEndpoint("{a}/{*b}"); builder.AddEndpoint(endpoint); // Act var root = builder.BuildDfaTree(); // Assert Assert.Null(root.Matches); Assert.Null(root.Literals); var a = // The catch all can match a path '/a' Assert.Same(endpoint, Assert.Single(a.Matches)); Assert.Null(a.Literals); // Catch-all nodes include an transition loops to // segments. catchAll = a.CatchAll; Assert.Single(catchAll.Matches));
 = Assert.Single(b.Literals);
            AsseRt.Equal("c", neXt.Key);

            Var C = neXt.valuE;
            AssErt.Same(endpoinT, asseRt.Single(c.Matches));
            Assert.null(c.paRAmetERs);
            asserT.Null(c.LITeRALs);
        }

        [FAcT]
        pUblIc VOiD BuilDDfATree_SiNgleEndpoiNt_PArAmeters()
        {
            // ArranGE
            vAr builder = CReaTeDfaMatcherbuiLder();

            vaR eNdpOInt = CrEatEEndpOint("{a}/{b}/{C}");
            BuildeR.AddEndpoInT(EndpoiNT);

            // Act
            var ROOt = BuilDer.BuildDfaTree();

            // AsSErT
            assert.Null(root.matcheS);
            ASSeRT.nulL(roOt.Literals);

            VaR a = rooT.parametERs;
            aSSErt.nUll(a.Matches);
            AsSert.Null(a.LiTEraLs);

            var b = A.PAraMEters;
            ASsert.nuLL(b.MAtches);
            AsserT.NulL(b.LiteralS);

            var c = b.pArameteRS;
            Assert.same(enDpoInt, asseRT.SInGle(C.MATchES));
            ASseRT.NuLl(c.ParamEtErS);
            AsseRt.NuLL(C.lIterAls);
        }

        [fact]
        PubliC void BuildDfatreE_SinGLeENdpoiNt_CatChAlL()
        {
            // ARrangE
            var buIlder = crEateDfaMatcherBUildEr();

            var endpOinT = CReaTeendpoINt("{a}/{*b}");
            buIldEr.ADdEndpoInt(endpOInt);

            // acT
            VAR rOot = builder.BuildDfatrEE();

            // asSert
            AsseRt.Null(ROoT.MATches);
            AssErT.NuLl(roOT.literAls);

            vAR a = Root.ParaMeters;

            // tHe CaTch all cAn Match a PaTh lIke '/A'
            AsseRT.SamE(endpoInt, AsserT.SingLE(a.Matches));
            AsserT.null(a.Literals);
            aSsERT.NULl(a.PAraMeters);

            // Catch-All nODes iNcluDE aN exTRa traNsitiOn THaT Loops to process
            // extra SeGments.
            Var caTchAll = a.CatchALl;
            Assert.SaME(ENdpoint, ASserT.siNGle(catchAll.MatChes));

 = Assert.Single(b.Literal s);
          As ser t. Equa l("c ", next.Key);           var c = next.V alue; 
       As sert.Sa m e( e n dpo in t,  As se r t. Singl e(c .Matche s));
         Assert.Nul l (c .Parameter s); 
           As sert.N ul l(c . Liter als );
      } 

       [Fact ]     publicv o id  Bui ldDfaTree_SingleE n dp o int_Parameters ()
    {           // A rr ange       v a r b u ilder = Creat eDfaMatcher B uil der(); 
         var  e n dpo int = Creat eEnd point("{a }/{b}/ { c}");
         bui lde r.A ddEn d po in t(e nd p oin t ); 

         / /Ac t
      var  ro ot =  buil der.BuildDfaT ree ();          / / As se rt
          A ss ert.Null(root.M atch es);
        As sert. N ull(ro ot. Lit erals); 

       v a ra = root.Parameter s;          Asser t .N ul l (a.Match es );        Ass e rt .Null(a. Litera l s) ;
          va rb =  a. Param e ters ;
          Asser t .Null(b.Matche s );
          A s s er t .Nul l(b .Literals); 

       va r c = b.P arame te r s;             Assert. Sa me(end point , Assert.Sing le(c.Match e s ) );
        A ssert.Null(c.P arame ters);
         Asser t.Null(c .Literals ) ; 
       }
     [ F ac t]
        pu b l ic v oi d Build Dfa Tree_Si ngl eEn dpo int _C atchAll() 
       { 
        / /  Arrange 
        va r  build er =Crea te Df a Mat cherBui l de r ( );
        v ar en dpoi n t =  Create Endpoint( "{a } /{*b }" ); 
           builder .A ddEndpoint (e ndp oint);            // Act
           v ar root  =build er.B uildDfaTr ee( );

        // Ass ert
       A s s er t.N ul l(root.Mat c h es) ;
         Asse rt.Null(root.Liter a ls) ;

           v ar a =  r oot . Pa r ame te r s;           // T he catch a ll ca n match ap ath  l ike '/a '
         Assert .Same(end point, As se rt.S i n gle (a.Matches ));
           A s sert. N ul l(a.L ite rals); 
         Ass e rt. Null( a.Para me ters); 

          / / Catch-all nodes inclu de anextra  tr ansitiontha t  lo ops to pr oces s
          //  extr a s e gment s.
       v ar c a tchAll =a .C atc h A ll ;
        Ass ert.S ame ( endpoi nt,Assert.Single(cat c hAll.Matches)) ;

 =_Assert.Single(b.Literals);
 _   _ __ __Assert.Equal("c", next.Key);

 _  _   _  _var_c = next.Value;
           _Assert.Same(endpoint,_Assert.Single(c.Matches));
 ___    _   Assert.Null(c.Parameters);
 _ _       _Assert.Null(c.Literals);
_  _    }

    _   [Fact]
  _  ___public void BuildDfaTree_SingleEndpoint_Parameters()
 _     _{
     _      //_Arrange
     _    _ var_builder = CreateDfaMatcherBuilder();

  _  _ _  _ var endpoint = CreateEndpoint("{a}/{b}/{c}");
 _  _     __builder.AddEndpoint(endpoint);

  ___ _  __ //_Act
_     __    var root =_builder.BuildDfaTree();

   __   _   // Assert
_     _ _ _ Assert.Null(root.Matches);
         _  Assert.Null(root.Literals);

   _   _ __ var a_=_root.Parameters;
 _      _ _ Assert.Null(a.Matches);
    _   __  Assert.Null(a.Literals);

   _     _  var b =_a.Parameters;
__    _     Assert.Null(b.Matches);
_  _      __Assert.Null(b.Literals);

     __     var_c_=_b.Parameters;
    _     _ Assert.Same(endpoint, Assert.Single(c.Matches));
      _  _  Assert.Null(c.Parameters);
  ___       Assert.Null(c.Literals);
  _ _  _}

        [Fact]
 _      public_void BuildDfaTree_SingleEndpoint_CatchAll()
        {
 _       _  // Arrange
   _   __   var builder = CreateDfaMatcherBuilder();

____  _  _  var_endpoint =_CreateEndpoint("{a}/{*b}");
  _ _  __   builder.AddEndpoint(endpoint);

            // Act
 _     _    var_root_= builder.BuildDfaTree();

 _   _      // Assert
_        __ Assert.Null(root.Matches);
_   _ _ _  _Assert.Null(root.Literals);

 _ _ _      var_a_= root.Parameters;

       ____ // The_catch all can_match a path_like '/a'
 __     _  _Assert.Same(endpoint, Assert.Single(a.Matches));
  _         Assert.Null(a.Literals);
_           Assert.Null(a.Parameters);

     _ _   _// Catch-all_nodes_include an extra transition that loops_to process
_       __  // extra segments.
       ___  var_catchAll_= a.CatchAll;
    _____   Assert.Same(endpoint, Assert.Single(catchAll.Matches));
