Skip to content

Commit

Permalink
TNT-42554 ODD - include default content with response tokens options …
Browse files Browse the repository at this point in the history
…in the response (#31)

* TNT-42554 ODD - include default content options in the response

* Fix test models so we don't have empty objects in expected responses
  • Loading branch information
XDex authored Oct 28, 2021
1 parent b70bf31 commit fa0848d
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private static bool HandleMboxRequest(
option.EventToken = null;
return option;
})
.Where(option => option.Type != null || option.Content != null)
.Where(option => option.Type != null || option.Content != null || option.ResponseTokens != null)
.ToList(),
Trace = traceHandler?.CurrentTrace,
};
Expand Down Expand Up @@ -249,7 +249,7 @@ private static bool HandlePageLoad(
option.EventToken = null;
}

if (option.Type == null && option.Content == null && option.EventToken == null)
if (option.Type == null && option.Content == null && option.EventToken == null && option.ResponseTokens == null)
{
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
}
}
]
},
{
"responseTokens": {}
}
],
"metrics": [
Expand Down Expand Up @@ -173,6 +176,15 @@
}
}
]
},
{
"responseTokens": {}
},
{
"responseTokens": {}
},
{
"responseTokens": {}
}
],
"metrics": [
Expand Down Expand Up @@ -301,6 +313,21 @@
}
}
]
},
{
"responseTokens": {}
},
{
"responseTokens": {}
},
{
"responseTokens": {}
},
{
"responseTokens": {}
},
{
"responseTokens": {}
}
],
"metrics": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
"content": "greg is correct"
}
]
},
{
"responseTokens": {}
},
{
"responseTokens": {}
}
],
"metrics": [
Expand Down Expand Up @@ -123,6 +129,12 @@
"content": "jason is correct"
}
]
},
{
"responseTokens": {}
},
{
"responseTokens": {}
}
],
"metrics": [
Expand Down Expand Up @@ -183,6 +195,12 @@
"content": "all visitors"
}
]
},
{
"responseTokens": {}
},
{
"responseTokens": {}
}
],
"metrics": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private static EquivalencyAssertionOptions<T> NestedResponseEquivalenceOptions<T
.ComparingByMembers<Action>()
.Using<Dictionary<string, object>>(ctx =>
{
if (ctx.Expectation == null)
if (ctx.Expectation == null || ctx.Expectation.Count == 0)
{
return;
}
Expand Down

0 comments on commit fa0848d

Please sign in to comment.