Esempio n. 1
0
        public async Task GetLogs_ShouldLoadAllLogs()
        {
            List <Log> logList = new List <Log> {
                new Log()
            };

            _logDataServiceMock = new Mock <ILogDataService>();
            _logDataServiceMock.Setup(f => f.GetAllLogs()).ReturnsAsync(logList);

            _sut = new LogViewModel(_logDataServiceMock.Object);
            await _sut.GetLogs();

            Assert.That(_sut.Logs, Is.EqualTo(logList));
            _logDataServiceMock.Verify(repo => repo.GetAllLogs(), Times.AtLeast(2));
        }