Timeline entity causing serverside tests to not compile

Details

Type: C#Bot
Bot Version: 2.5.1.0 (Also had issue on 2.4.0.0)
Browser / OS: N/A

Description

Serverside tests do not compile, there is a compilation error in the TimelineBehavourTest.cs file.

The issue seems to stem from having an entity with the timeline behaviour with no access on the security model.

Attempted Resolutions

Tried:

  • Upgrading bot version from 2.4.0.0 to 2.5.1.0
  • Checked the .csproj file for the serverside tests to ensure no protected regions were in use that may have caused this

Hi Hayden

We have investigated this issue and have found the cause to be some outdated code that has slipped under the radar. We will fix this in an upcoming bot version but for the time being you can implement the following fix in the provided protected regions.

In the controller log tests replace the following code

data.Should().BeEmpty("Should be empty because security denies all access");

with

data.Data.Select(d => d.EntityId).Should().Contain(entityResult.Id);

In the quick jump options tests, replace the following

quickJumpOptions.Should().BeNull("Should be null because security denies all access");

with

foreach (var eventEntity in eventEntities)
{
	Assert.Contains(quickJumpOptions, x => x.StartDate <= eventEntity.Created && x.EndDate > eventEntity.Created);
}

And finally in the graph data tests, replace the following

graphQueryResults.Should().BeNull("Should be null because security denies all access");

with

foreach (var graphQueryResult in graphQueryResults)
{
	var dateRange = graphQueryResult.DateTimeGroup;
	var numEventsInDateRange = eventEntities
		.Count(x => x.Created >= dateRange.StartDate && x.Created < dateRange.EndDate);
	graphQueryResult.NumberOfResults.Should().Be(numEventsInDateRange);
}

This should make your tests pass until the proper fix is released.

Hi @hayden.steel,

Thanks again for submitting this!

A fix is now available in C#Bot Release 2.6.0.0.