Add two tests for project model server

This commit is contained in:
Troy Dai 2016-04-03 19:29:23 -07:00
parent 60b23d5115
commit 9cec3e3152
4 changed files with 153 additions and 8 deletions

View file

@ -70,6 +70,21 @@ namespace Microsoft.DotNet.ProjectModel.Server.Tests
return array;
}
public static JArray AssertJArrayNotContains<T>(this JArray array, Func<T, bool> critiera)
{
foreach (var element in array)
{
var value = element.Value<T>();
if (critiera(value))
{
Assert.True(false, "JArray contains unexpected element.");
}
}
return array;
}
public static T RetrieveArraryElementAs<T>(this JArray json, int index)
where T : JToken
{