22using System . Linq ;
33using NUnit . Framework ;
44using ServiceStack . Common . Tests . Models ;
5+ using ServiceStack . Text ;
56
67namespace ServiceStack . OrmLite . Tests
78{
@@ -66,14 +67,15 @@ public void Lists_Of_Guids_Are_Formatted_Correctly()
6667 {
6768 using ( var db = OpenDbConnection ( ) )
6869 {
69- db . CreateTable < WithAListOfGuids > ( true ) ;
70+ db . DropAndCreateTable < WithAListOfGuids > ( ) ;
7071
71- var item = new WithAListOfGuids
72- {
73- GuidOne = new Guid ( "32cb0acb-db43-4061-a6aa-7f4902a7002a" ) ,
74- GuidTwo = new Guid ( "13083231-b005-4ff4-ab62-41bdc7f50a4d" ) ,
75- TheGuids = new [ ] { new Guid ( "18176030-7a1c-4288-82df-a52f71832381" ) , new Guid ( "017f986b-f7be-4b6f-b978-ff05fba3b0aa" ) } ,
76- } ;
72+ JsConfig < Guid > . RawSerializeFn = x => x . ToString ( ) ;
73+
74+ var item = new WithAListOfGuids {
75+ GuidOne = new Guid ( "32cb0acb-db43-4061-a6aa-7f4902a7002a" ) ,
76+ GuidTwo = new Guid ( "13083231-b005-4ff4-ab62-41bdc7f50a4d" ) ,
77+ TheGuids = new [ ] { new Guid ( "18176030-7a1c-4288-82df-a52f71832381" ) , new Guid ( "017f986b-f7be-4b6f-b978-ff05fba3b0aa" ) } ,
78+ } ;
7779
7880 db . Insert ( item ) ;
7981
@@ -85,6 +87,8 @@ public void Lists_Of_Guids_Are_Formatted_Correctly()
8587
8688 var savedGuidList = db . Select < string > ( "SELECT TheGuids FROM WithAListOfGuids" ) . First ( ) ;
8789 Assert . That ( savedGuidList , Is . EqualTo ( "[18176030-7a1c-4288-82df-a52f71832381,017f986b-f7be-4b6f-b978-ff05fba3b0aa]" ) ) ;
90+
91+ JsConfig . Reset ( ) ;
8892 }
8993 }
9094
0 commit comments