This commit is contained in:
@@ -19,6 +19,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void PhraseOnlySearchShouldWork()
|
||||
{
|
||||
const string TEST_SEARCH_PHRASE = "simple dogs";
|
||||
|
||||
//CREATE A WIDGET
|
||||
dynamic D = new JObject();
|
||||
@@ -32,8 +33,21 @@ namespace raven_integration
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long FirstWidgetId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
|
||||
//CREATE A SECOND WIDGET
|
||||
D = new JObject();
|
||||
D.name = Util.Uniquify("Search Simple SECOND Test WIDGET");
|
||||
D.name = Util.Uniquify("Search simple as in dogs SECOND Test WIDGET");
|
||||
D.dollarAmount = 1.11m;
|
||||
D.active = true;
|
||||
D.roles = 0;
|
||||
D.notes = "This Widget should be returned in the search as it contains both keywords in the name";
|
||||
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long SecondWidgetId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
|
||||
//CREATE A THIRD WIDGET
|
||||
D = new JObject();
|
||||
D.name = Util.Uniquify("Search Simple THIRD Test WIDGET");
|
||||
D.dollarAmount = 1.11m;
|
||||
D.active = true;
|
||||
D.roles = 0;
|
||||
@@ -41,11 +55,12 @@ namespace raven_integration
|
||||
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long SecondWidgetId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
long ThirdWidgetId = a.ObjectResponse["result"]["id"].Value<long>();
|
||||
|
||||
//Now see if can find that widget with a phrase search
|
||||
dynamic SearchParameters = new JObject();
|
||||
SearchParameters.phrase = "simple dogs";
|
||||
|
||||
SearchParameters.phrase = TEST_SEARCH_PHRASE;
|
||||
SearchParameters.nameOnly = false;
|
||||
SearchParameters.typeOnly = 0;//no type
|
||||
a = await Util.PostAsync("Search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
|
||||
Reference in New Issue
Block a user