Exemplo n.º 1
0
        public async Task GetAudit_CompletedRegistrationWithSingleFullView_ViewsReturned()
        {
            var incidentCommunity = await GetRandomSeededCommunity();

            var taskId = await SeedIncident(incidentCommunity.Id);

            var hostCommunity = await GetRandomSeededCommunity();

            var completedReg = RegistrationGenerator.GenerateCompleted(taskId, hostCommunity.Id);
            var regId        = await di.CreateEvacueeRegistrationAsync(completedReg);

            const string reason = "want to read";
            await mediator.Send(new RegistrationQueryRequest(regId, reason));

            var result = await mediator.Send(new RegistrationAuditQueryRequest(long.Parse(regId)));

            var entry = result.First();

            Assert.Equal(reason, entry.Reason);
            Assert.Equal(regId, entry.EssFileNumber);
            Assert.Equal("System", entry.UserName);
            Assert.Equal(DateTime.Now, TimeZoneConverter.GetLocalDateTime(entry.DateViewed), TimeSpan.FromSeconds(1));
        }