This commit is contained in:
2018-09-28 18:10:47 +00:00
parent 70fc47177f
commit d1b6a7d747
4 changed files with 54 additions and 7 deletions

View File

@@ -38,11 +38,12 @@ namespace raven_integration
ApiResponse EventLogResponse = await Util.GetAsync($"EventLog/ObjectLog?AyType=2&AyId={w2Id}", await Util.GetTokenAsync("BizAdminFull"));
Util.ValidateHTTPStatusCode(EventLogResponse, 200);
TODO: failing here, for no reason that makes any sense it thinks there are two created events by two users for the same widget.
//NOTE:was failing here, for no reason that makes any sense it thinks there are two created events by two users for the same widget.
//might have been some temporary bad code in the seeder at one point when I was experimenting with async stuff
((JArray)EventLogResponse.ObjectResponse["result"]).Count.Should().Be(1);//only one event so far
EventLogResponse.ObjectResponse["result"][0]["date"].Value<DateTime>().Should().BeLessThan(new TimeSpan(1, 0, 0)).Before(DateTime.UtcNow);//should be less than one hour before now
((JArray)EventLogResponse.ObjectResponse["result"]).Count.Should().Be(1);//only one event so far
EventLogResponse.ObjectResponse["result"][0]["date"].Value<DateTime>().Should().BeLessThan(new TimeSpan(1, 0, 0)).Before(DateTime.UtcNow);//should be less than one hour before now
EventLogResponse.ObjectResponse["result"][0]["userId"].Should().NotBeNull();
EventLogResponse.ObjectResponse["result"][0]["event"].Value<int>().Should().Be(1);//AyEvent 1 = created
EventLogResponse.ObjectResponse["result"][0]["textra"].Should().BeNullOrEmpty();

View File

@@ -449,6 +449,43 @@ namespace raven_integration
}//eot
[Fact]
public async void BigDataSearchShouldBeRelativelyFast()
{
//THIS test is a bit different in that it relies partly on the big dataset for testing
//so it has different paths depending upon if it's testing against the big data or not
const string TEST_SEARCH_PHRASE = "et*";
//Now see if can find those objects with a phrase search
dynamic SearchParameters = new JObject();
SearchParameters.phrase = TEST_SEARCH_PHRASE;
SearchParameters.nameOnly = false;
SearchParameters.typeOnly = 0;//no type
SearchParameters.maxResults = 1000;//default is 500
var watch = new System.Diagnostics.Stopwatch();
watch.Start();
ApiResponse a = await Util.PostAsync("Search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
watch.Stop();
var TimeToSearch = watch.ElapsedMilliseconds;
Util.ValidateDataReturnResponseOk(a);
//Now validate the return list
var ResultCount = ((JArray)a.ObjectResponse["result"]).Count;
//assert it's not unbounded
ResultCount.Should().BeLessOrEqualTo(1000);
//1755ms is the longest I've seen in initial testing so setting slightly above
TimeToSearch.Should().BeLessThan(1760, "Big data search should not be too slow");
}//eot
//==================================================
}//eoc