HTML5¼¼Êõ

̸һÏÂÎÒÃÇÊÇÔõô×öÊý¾Ý¿âµ¥Ôª²âÊÔ(Database Unit Test)µÄ - HarlanC(2)

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2017-06-17 12:00 ÎÒÒªÆÀÂÛ( )

Ìí¼ÓÒ»¸öÀà ÓÒ¼üDBUTDemo-Add-New Item... Ñ¡ÔñSQL Server Unit Test,ÊäÈëÃû×Ö£¬µã»÷Add¡£ µÚÒ»´ÎÌí¼ÓÊý¾Ý¿â²âÊÔÀàÐèÒªÅäÖÃÊý¾Ý¿â£º µã»÷New Connection¡£ ÊäÈëServer name,Ñ¡ÔñÎÒÃǸղŴ´½¨µÄÊý¾Ý¿âDBUTDemo,µã»÷T

Ìí¼ÓÒ»¸öÀà
  • ÓÒ¼üDBUTDemo->Add->New Item...


    Ñ¡ÔñSQL Server Unit Test,ÊäÈëÃû×Ö£¬µã»÷Add¡£

  • µÚÒ»´ÎÌí¼ÓÊý¾Ý¿â²âÊÔÀàÐèÒªÅäÖÃÊý¾Ý¿â£º
    µã»÷New Connection¡£
  • ÊäÈëServer name,Ñ¡ÔñÎÒÃǸղŴ´½¨µÄÊý¾Ý¿âDBUTDemo,µã»÷Test Connection¡£Èç¹û³É¹¦»áµ¯³ö¶Ô»°¿ò¡£Á¬ÐøÁ½´Îµã»÷OK¡£Êý¾Ý¿âÅäÖþÍÍê³ÉÁË¡£

    ´´½¨Èý¸öActions

    µã»÷Click here to createÀ´´´½¨TestAction,µã»÷Ö®ºó·¢ÏÖ¶àÁËÒ»¸öresxÎļþ¡£

    ÊäÈëÏÂÃæµÄ²âÊÔ´úÂ룺

    declare @return_value int, @name nvarchar(50) EXEC @return_value = [dbo].[GetBasicRevenueByName] @name = N'three zhang' SELECT 'Return Value' = @return_value

    ½ÓÏÂÀ´´´½¨ÁíÍâÁ½¸öAction£º

    ·Ö±ðÊäÈëÈçÏ´úÂ룺

    insert into EmployeeBasicInfo values(1,'three zhang', '16625344257') insert into EmployeeBasicInfo values(2,'four li', '16625344258') insert into EmployeeBasicInfo values(3,'simon', '16625344259') insert into EmployeeBasicInfo values(4,'jack', '16625344250') insert into EmployeeRevenue values(1 ,30000 ,500 ,20000) insert into EmployeeRevenue values(2 ,28000 ,500 ,19000) insert into EmployeeRevenue values(3 ,27000 ,500 ,10000) insert into EmployeeRevenue values(4 ,26000 ,500 ,20000) delete from EmployeeRevenue delete from EmployeeBasicInfo

    ×îºóÌí¼Ó²âÊÔÌõ¼þ


    ÎÒÃÇÌí¼ÓÁËÁ½¸ö²âÊÔÌõ¼þ£¬Öµ¿ÉÒÔÔÚÊôÐÔ½çÃæÖÐÐ޸ģº
    µÚÒ»¸ö²âÊÔÌõ¼þÊÇÔÚ·µ»Ø½á¹û¼¯1ÖУ¬µÚÒ»ÐеڶþÁеÄÆÚÍûֵΪ30000£¬Ò²¾ÍÊÇthree zhangµÄ»ù±¾¹¤×ÊΪ30000¡£

    µÚ¶þ¸ö²âÊÔÌõ¼þ²âÊÔ½á¹û¼¯1·Ç¿Õ¡£

    ±àÒë,ÔËÐÐ

    ±àÒë³É¹¦ºó£¬´ò¿ªTest Explorer,runÎÒÃǸղŴ´½¨µÄcase,²âÊÔͨ¹ý¡£

    Ordered Test

    ×îºó˵ÏÂÊý¾Ý¿â²âÊÔÓÃÀýÈç¹ûÐèÒª¹Ì¶¨µÄ˳Ðò¸ÃÔõô°ì£¬Î¢ÈíÌṩÁËÒ»ÖÖ²âÊÔÓÃÀýÀàÐͽÐ×öOrdered Test:

    ÕâÖÖcaseÊǰѼ¸¸öcase¼¯ºÏ³ÉΪÁËÒ»¸ö£¬¿ÉÒÔ×Ô¼ºÑ¡ÔñÐèÒªÔËÐеÄÆÕͨµÄcase£¬×Ô¼ºÖ¸¶¨Ë³Ðò¡£ÒòΪ˳Ðò¹Ì¶¨ÁË£¬ÕâЩcasesÖÐʹÓõÄÊý¾Ý¾ÍÊǿɿصģ¬Òò´ËÔÚÒ»¸öordered caseÖеļ¸¸öcase¿ÉÒÔ¹²Í¬Ê¹ÓÃijЩÊý¾Ý£¬ÎÒÃÇ¿ÉÒÔ½«Êý¾Ý¸ôÀëµÄµ¥Î»Óɵ¥¸öcase±äΪ¼¸¸öcaseÉõÖÁÒ»¸öÀàÖеÄËùÓÐcases¡£

    posted @

    ¡¡

    1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

    Ïà¹ØÎÄÕÂ
    • ̸һÏÂÎÒÃÇÊÇÈçºÎ¿ªÕ¹code reviewµÄ - HarlanC

      ̸һÏÂÎÒÃÇÊÇÈçºÎ¿ªÕ¹code reviewµÄ - HarlanC

      2017-04-27 15:03

    • 2ÄêÇ°¶ËѧϰÀú³Ì£¬ÓëÕÒ²»µ½¹¤×÷µÄ±¯·ßÓëͲۣ¡£¨100%Õæʵ¾­Àú£¬¿´²©Ö÷Ôõôһ²½²½×ßÏòʧҵ£© - ½¯ÆôîÛ

      2ÄêÇ°¶ËѧϰÀú³Ì£¬ÓëÕÒ²»µ½¹¤×÷µÄ±¯·ßÓëͲۣ¡£¨100%Õæʵ¾­Àú£¬¿´²©

      2017-03-29 11:00

    • Asp.Net MVCѧϰ×ܽᣨÈý£©¡ª¡ª¹ýÂËÆ÷ÄãÔõô¿´£¿ - SeeYouBug

      Asp.Net MVCѧϰ×ܽᣨÈý£©¡ª¡ª¹ýÂËÆ÷ÄãÔõô¿´£¿ - SeeYouBug

      2017-03-06 17:01

    • EntityFramework Core 1.1ÓÐÄÄЩÐÂÌØÐÔÄØ£¿ÎÒÃÇÐèÒªÖªµÀ - JeffckyWang

      EntityFramework Core 1.1ÓÐÄÄЩÐÂÌØÐÔÄØ£¿ÎÒÃÇÐèÒªÖªµÀ - JeffckyWa

      2017-01-22 18:01

    ÍøÓѵãÆÀ
    ½