2
2
using System . Linq ;
3
3
using NUnit . Framework ;
4
4
using ServiceStack . Common . Tests . Models ;
5
+ using ServiceStack . Text ;
5
6
6
7
namespace ServiceStack . OrmLite . Tests
7
8
{
@@ -66,14 +67,15 @@ public void Lists_Of_Guids_Are_Formatted_Correctly()
66
67
{
67
68
using ( var db = OpenDbConnection ( ) )
68
69
{
69
- db . CreateTable < WithAListOfGuids > ( true ) ;
70
+ db . DropAndCreateTable < WithAListOfGuids > ( ) ;
70
71
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
+ } ;
77
79
78
80
db . Insert ( item ) ;
79
81
@@ -85,6 +87,8 @@ public void Lists_Of_Guids_Are_Formatted_Correctly()
85
87
86
88
var savedGuidList = db . Select < string > ( "SELECT TheGuids FROM WithAListOfGuids" ) . First ( ) ;
87
89
Assert . That ( savedGuidList , Is . EqualTo ( "[18176030-7a1c-4288-82df-a52f71832381,017f986b-f7be-4b6f-b978-ff05fba3b0aa]" ) ) ;
90
+
91
+ JsConfig . Reset ( ) ;
88
92
}
89
93
}
90
94
0 commit comments