Skip to content

Commit

Permalink
Merge pull request #13 from Janus-vistaprint/SupportForJObject
Browse files Browse the repository at this point in the history
Support for j object
  • Loading branch information
TerribleDev authored May 10, 2018
2 parents 463fc03 + 1c9b8c9 commit 925a5d2
Show file tree
Hide file tree
Showing 26 changed files with 1,099 additions and 28 deletions.
8 changes: 4 additions & 4 deletions OKLogger.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2005
VisualStudioVersion = 15.0.27004.2009
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B5000E86-781F-480F-B687-6E50201A471C}"
EndProject
Expand All @@ -20,9 +20,6 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OKLogger.PerformanceTestsHarness", "src\OKLogger.PerformanceTestsHarness\OKLogger.PerformanceTestsHarness.csproj", "{16965038-71F0-4A9E-B76E-8E46BF54CC05}"
EndProject
Global
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -109,4 +106,7 @@ Global
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
EndGlobal
1 change: 1 addition & 0 deletions src/OKLogger.TestHanress/OKLogger.TestHarness.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

<ItemGroup>
<PackageReference Include="microsoft.testplatform.testhost" Version="15.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
38 changes: 19 additions & 19 deletions src/OKLogger.Tests/FormattingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void ObjectFormatter_SimpleList()
var result = objectFormatter.Format(objectToFormat, 0);

Assert.Single(result);
Assert.Equal(result["Alpha"], "1,2,3,4,5");
Assert.Equal("1,2,3,4,5", result["Alpha"]);


}
Expand All @@ -66,9 +66,9 @@ public void DictionaryFormatter()
var result = objectFormatter.Format(objectToFormat, 0);

Assert.Equal(3, result.Count);
Assert.Equal(result["A"], "1");
Assert.Equal(result["B"], "2");
Assert.Equal(result["C"], "3");
Assert.Equal("1", result["A"]);
Assert.Equal("2", result["B"]);
Assert.Equal("3", result["C"]);


}
Expand Down Expand Up @@ -104,13 +104,13 @@ public void ObjectFormatter_Nested()
var duration = stopwatch.ElapsedMilliseconds;

Assert.Equal(7, result.Count);
Assert.Equal(result["Alpha"], "a");
Assert.Equal(result["Beta"], "1");
Assert.Equal(result["EnumProp"], "SecondValue");
Assert.Equal(result["Receiver_Name"], "bkennedy");
Assert.Equal(result["Receiver_User_Id"], "2");
Assert.Equal(result["Sender_Name"], "admin");
Assert.Equal(result["Sender_User_Id"], "1");
Assert.Equal("a",result["Alpha"]);
Assert.Equal("1",result["Beta"]);
Assert.Equal("SecondValue",result["EnumProp"]);
Assert.Equal("bkennedy",result["Receiver_Name"]);
Assert.Equal("2",result["Receiver_User_Id"]);
Assert.Equal("admin", result["Sender_Name"]);
Assert.Equal("1",result["Sender_User_Id"]);


}
Expand All @@ -126,7 +126,7 @@ public void ArrayFormatter_Int()

Assert.Single(result);
Assert.True(result.ContainsKey(string.Empty), "Should have a single, empty key");
Assert.Equal(result[string.Empty], "1,2,3,4");
Assert.Equal("1,2,3,4", result[string.Empty]);



Expand All @@ -142,7 +142,7 @@ public void ArrayFormatter_Double()

Assert.Single(result);
Assert.True(result.ContainsKey(string.Empty), "Should have a single, empty key");
Assert.Equal(result[string.Empty], "1.1,2.2,3.3,4.4");
Assert.Equal("1.1,2.2,3.3,4.4", result[string.Empty]);

}

Expand All @@ -156,7 +156,7 @@ public void ArrayFormatter_String()

Assert.Single(result);
Assert.True(result.ContainsKey(string.Empty), "Should have a single, empty key");
Assert.Equal(result[string.Empty], "alpha,beta,gamma");
Assert.Equal("alpha,beta,gamma", result[string.Empty]);
}

[Fact]
Expand All @@ -169,7 +169,7 @@ public void GuidFormatter()

Assert.Single(result);
Assert.True(result.ContainsKey(string.Empty), "Should have a single, empty key");
Assert.Equal(result[string.Empty], "df0187e1-e1eb-4a9f-a528-4afebfecf4a5");
Assert.Equal("df0187e1-e1eb-4a9f-a528-4afebfecf4a5",result[string.Empty]);
}

[Fact]
Expand All @@ -182,7 +182,7 @@ public void EnumFormatter()

Assert.Single(result);
Assert.True(result.ContainsKey(string.Empty), "Should have a single, empty key");
Assert.Equal(result[string.Empty], "SecondValue");
Assert.Equal("SecondValue", result[string.Empty]);
}


Expand All @@ -196,7 +196,7 @@ public void EnumFormatter_Nullable_WithValue()

Assert.Single(result);
Assert.True(result.ContainsKey(string.Empty), "Should have a single, empty key");
Assert.Equal(result[string.Empty], "SecondValue");
Assert.Equal("SecondValue", result[string.Empty]);
}


Expand All @@ -223,7 +223,7 @@ public void Nullable_Integer_With_Value()

Assert.Single(result);
Assert.True(result.ContainsKey(string.Empty), "Should have a single, empty key");
Assert.Equal(result[string.Empty], "3");
Assert.Equal("3", result[string.Empty]);
}

[Fact]
Expand Down Expand Up @@ -268,7 +268,7 @@ public void PropParser_Escape()

Assert.Equal(1, result.Count);
Assert.True(result.ContainsKey("A"), "Should have a single, empty key");
Assert.Equal(result["A"], "test_S_tring");
Assert.Equal("test_S_tring", result["A"]);
}

[Fact]
Expand Down
Loading

0 comments on commit 925a5d2

Please sign in to comment.