Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 853a9ed

Browse files
committed
Fix tests
1 parent ce2e4b3 commit 853a9ed

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/ServiceStack.Text/ReflectionExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,6 +1688,10 @@ public static Type GetCollectionType(this Type type)
16881688

16891689
public static Dictionary<string, object> ToObjectDictionary<T>(this T obj)
16901690
{
1691+
var alreadyDict = obj as Dictionary<string, object>;
1692+
if (alreadyDict != null)
1693+
return alreadyDict;
1694+
16911695
var dict = new Dictionary<string, object>();
16921696

16931697
foreach (var pi in obj.GetType().GetSerializableProperties())

tests/ServiceStack.Text.Tests/CsvTypeTests.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@ namespace ServiceStack.Text.Tests
99
[TestFixture]
1010
public class CsvTypeTests
1111
{
12-
private int id = 0;
12+
private int id;
1313
static string[] Names = new[] { "Foo", "Bar" };
1414

1515
object Create(string name)
1616
{
1717
return new { id = ++id, name = name };
1818
}
1919

20+
[SetUp]
21+
public void SetUp()
22+
{
23+
id = 0;
24+
}
25+
2026
[Test]
2127
public void Can_serialize_Dynamic_List()
2228
{

0 commit comments

Comments
 (0)