public async Task FullHistoryOfLogs_GetsTranslatedToChangesCorrectly()
        {
            // Arrange
            var auditLogs = GetAuditLogs("auditLogsForNotification1");

            _auditServiceMock.Setup(service => service.GetWriteAuditsForNotification(1))
            .ReturnsAsync(auditLogs);
            _userRepositoryMock.Setup(repo => repo.GetUsernameDictionary())
            .ReturnsAsync(new Dictionary <string, string> {
                { "*****@*****.**", "John Johnson" }
            });

            // Act
            var changes = (await _changesService.GetChangesList(1)).ToList();

            // Assert
            Assert.Collection(PrintInOrder(changes),
                              c => Assert.Equal("25 Jun 2020, 15:33 John Johnson denotified Notification", c),
                              c => Assert.Equal("25 Jun 2020, 15:18 John Johnson rejected Transfer", c),
                              c => Assert.Equal("25 Jun 2020, 15:18 John Johnson requested Transfer", c),
                              c => Assert.Equal("25 Jun 2020, 15:00 John Johnson accepted Transfer", c),
                              c => Assert.Equal("25 Jun 2020, 14:59 John Johnson requested Transfer", c),
                              c => Assert.Equal("25 Jun 2020, 11:34 John Johnson unmatched Specimen", c),
                              c => Assert.Equal("25 Jun 2020, 11:34 John Johnson matched Specimen", c),
                              c => Assert.Equal("25 Jun 2020, 11:22 NTBS updated Cluster membership", c),
                              c => Assert.Equal("25 Jun 2020, 11:19 NTBS updated Cluster membership", c),
                              c => Assert.Equal("24 Jun 2020, 18:13 John Johnson added M. bovis - unpasteurised milk consumption", c),
                              c => Assert.Equal("24 Jun 2020, 18:13 John Johnson updated M. bovis details", c),
                              c => Assert.Equal("24 Jun 2020, 18:13 John Johnson added M. bovis - exposure to another case", c),
                              c => Assert.Equal("24 Jun 2020, 18:12 John Johnson updated M. bovis details", c),
                              c => Assert.Equal("24 Jun 2020, 18:00 John Johnson updated MDR Details", c),
                              c => Assert.Equal("23 Jun 2020, 11:43 John Johnson updated Social Risk Factors", c),
                              c => Assert.Equal("23 Jun 2020, 11:40 John Johnson updated Social Context Venue", c),
                              c => Assert.Equal("23 Jun 2020, 11:23 John Johnson deleted Social Context Venue", c),
                              c => Assert.Equal("23 Jun 2020, 10:44 John Johnson updated Previous History", c),
                              c => Assert.Equal("23 Jun 2020, 10:44 John Johnson added Social Context Venue", c),
                              c => Assert.Equal("23 Jun 2020, 10:44 John Johnson added Social Context Venue", c),
                              c => Assert.Equal("23 Jun 2020, 10:42 John Johnson added Social Context Address", c),
                              c => Assert.Equal("23 Jun 2020, 10:41 John Johnson updated Immunosuppression", c),
                              c => Assert.Equal("23 Jun 2020, 10:41 John Johnson updated Co-morbidities", c),
                              c => Assert.Equal("23 Jun 2020, 10:41 John Johnson updated Visitor details", c),
                              c => Assert.Equal("23 Jun 2020, 10:41 John Johnson updated Travel details", c),
                              c => Assert.Equal("23 Jun 2020, 10:41 John Johnson updated Social Risk Factors", c),
                              c => Assert.Equal("23 Jun 2020, 10:41 John Johnson added Test result", c),
                              c => Assert.Equal("23 Jun 2020, 10:40 John Johnson updated Test Results", c),
                              c => Assert.Equal("23 Jun 2020, 10:40 John Johnson updated Contact Tracing", c),
                              c => Assert.Equal("23 Jun 2020, 10:40 John Johnson added Treatment event", c),
                              c => Assert.Equal("23 Jun 2020, 10:39 John Johnson updated Notification", c),
                              c => Assert.Equal("23 Jun 2020, 10:39 John Johnson updated Clinical Details", c),
                              c => Assert.Equal("23 Jun 2020, 10:39 John Johnson updated Hospital details", c),
                              c => Assert.Equal("23 Jun 2020, 10:39 John Johnson updated Personal details", c),
                              c => Assert.Equal("23 Jun 2020, 09:44 John Johnson submitted Notification", c),
                              c => Assert.Equal("23 Jun 2020, 09:41 John Johnson created Draft", c)
                              );
        }
Esempio n. 2
0
        public async Task FullHistoryOfLogs_GetsTranslatedToChangesCorrectly()
        {
            // Arrange
            var auditLogs = GetAuditLogs("auditLogsForNotification1");

            _auditServiceMock.Setup(service => service.GetWriteAuditsForNotification(1))
            .ReturnsAsync(auditLogs);

            // Act
            var changes = (await _changesService.GetChangesList(1)).ToList();

            // Assert
            Assert.Collection(PrintInOrder(changes),
                              c => Assert.Equal("25 Jun 2020, 15:33 John Johnson denotified Notification", c),
                              c => Assert.Equal("25 Jun 2020, 15:18 John Johnson rejected Transfer", c),
                              c => Assert.Equal("25 Jun 2020, 15:18 John Johnson requested Transfer", c),
                              c => Assert.Equal("25 Jun 2020, 15:00 John Johnson accepted Transfer", c),
                              c => Assert.Equal("25 Jun 2020, 14:59 John Johnson requested Transfer", c),
                              c => Assert.Equal("25 Jun 2020, 11:34 John Johnson unmatched Specimen", c),
                              c => Assert.Equal("25 Jun 2020, 11:34 John Johnson matched Specimen", c),
                              c => Assert.Equal("25 Jun 2020, 11:22 NTBS updated Cluster membership", c),
                              c => Assert.Equal("25 Jun 2020, 11:19 NTBS updated Cluster membership", c),
                              c => Assert.Equal("24 Jun 2020, 18:13 John Johnson added M. bovis - unpasteurised milk consumption", c),
                              c => Assert.Equal("24 Jun 2020, 18:13 John Johnson updated M. bovis details", c),
                              c => Assert.Equal("24 Jun 2020, 18:13 John Johnson added M. bovis - exposure to another case", c),
                              c => Assert.Equal("24 Jun 2020, 18:12 John Johnson updated M. bovis details", c),
                              c => Assert.Equal("24 Jun 2020, 18:00 John Johnson updated MDR details", c),
                              c => Assert.Equal("23 Jun 2020, 11:43 John Johnson updated Social risk factors", c),
                              c => Assert.Equal("23 Jun 2020, 11:40 John Johnson updated Social context venue", c),
                              c => Assert.Equal("23 Jun 2020, 11:23 John Johnson deleted Social context venue", c),
                              c => Assert.Equal("23 Jun 2020, 10:44 John Johnson updated Previous history", c),
                              c => Assert.Equal("23 Jun 2020, 10:44 John Johnson added Social context venue", c),
                              c => Assert.Equal("23 Jun 2020, 10:44 John Johnson added Social context venue", c),
                              c => Assert.Equal("23 Jun 2020, 10:42 John Johnson added Social context address", c),
                              c => Assert.Equal("23 Jun 2020, 10:41 John Johnson updated Immunosuppression", c),
                              c => Assert.Equal("23 Jun 2020, 10:41 John Johnson updated Co-morbidities", c),
                              c => Assert.Equal("23 Jun 2020, 10:41 John Johnson updated Visitor details", c),
                              c => Assert.Equal("23 Jun 2020, 10:41 John Johnson updated Travel details", c),
                              c => Assert.Equal("23 Jun 2020, 10:41 John Johnson updated Social risk factors", c),
                              c => Assert.Equal("23 Jun 2020, 10:41 John Johnson added Test result", c),
                              c => Assert.Equal("23 Jun 2020, 10:40 John Johnson updated Test results", c),
                              c => Assert.Equal("23 Jun 2020, 10:40 John Johnson updated Contact tracing", c),
                              c => Assert.Equal("23 Jun 2020, 10:40 John Johnson added Treatment event", c),
                              c => Assert.Equal("23 Jun 2020, 10:39 John Johnson updated Notification", c),
                              c => Assert.Equal("23 Jun 2020, 10:39 John Johnson updated Clinical details", c),
                              c => Assert.Equal("23 Jun 2020, 10:39 John Johnson updated Hospital details", c),
                              c => Assert.Equal("23 Jun 2020, 10:39 John Johnson updated Personal details", c),
                              c => Assert.Equal("23 Jun 2020, 09:44 John Johnson submitted Notification", c),
                              c => Assert.Equal("23 Jun 2020, 09:41 John Johnson created Draft", c)
                              );
            _logServiceMock.Verify(log => log.LogWarning(It.IsAny <string>()), Times.Never);
        }