Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mukunku committed Aug 30, 2023
1 parent 2dd4a51 commit ca4b5ab
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/ParquetViewer.Tests/SanityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ public async Task AMPLITUDE_EVENT_TEST()
RegularProperty = "yyy"
};

var isSelfContainedExecutable = false;
#if Release_SelfContained
isSelfContainedExecutable = true;
#endif

string expectedRequestJson = @$"
{{
""api_key"": ""dummy"",
Expand All @@ -199,7 +204,8 @@ public async Task AMPLITUDE_EVENT_TEST()
""autoSizeColumnsMode"": ""{AppSettings.AutoSizeColumnsMode}"",
""dateTimeDisplayFormat"": ""{AppSettings.DateTimeDisplayFormat}"",
""systemMemory"": {(int)(GC.GetGCMemoryInfo().TotalAvailableMemoryBytes / 1048576.0 /*magic number*/)},
""processorCount"": {Environment.ProcessorCount}
""processorCount"": {Environment.ProcessorCount},
""selfContainedExecutable"": {(isSelfContainedExecutable ? "true" : "false")}
}},
""event_properties"": {{
""regularProperty"": ""yyy""
Expand All @@ -218,6 +224,10 @@ public async Task AMPLITUDE_EVENT_TEST()
{
//Verify the request we're sending is what we expect it to be
string requestJsonBody = await (request.Content?.ReadAsStringAsync() ?? Task.FromResult(string.Empty));
var a = Regex.Replace(requestJsonBody, "\\s", string.Empty);
var b = Regex.Replace(expectedRequestJson, "\\s", string.Empty);
if (Regex.Replace(requestJsonBody, "\\s", string.Empty)
.Equals(Regex.Replace(expectedRequestJson, "\\s", string.Empty)))
return new HttpResponseMessage(System.Net.HttpStatusCode.OK);
Expand Down Expand Up @@ -248,7 +258,7 @@ public async Task NULLABLE_GUID_TEST1()
public async Task MALFORMED_DATETIME_TEST1()
{
using var parquetEngine = await ParquetEngine.OpenFileOrFolderAsync("Data/MALFORMED_DATETIME_TEST1.parquet", default);

var dataTable = await parquetEngine.ReadRowsAsync(parquetEngine.Fields, 0, int.MaxValue, default);
Assert.Equal(typeof(DateTime), dataTable.Rows[0]["ds"]?.GetType());

Expand Down

0 comments on commit ca4b5ab

Please sign in to comment.