Exemplo n.º 1
0
        public async Task GetOrganizedMatchInformation_ShouldBeDoneSuccessfully()
        {
            // Arrange
            var datePlayed    = DateTime.Now;
            var latestMatches = new List <OrganizedMatchInformationView>()
            {
                new OrganizedMatchInformationView()
                {
                    Id         = 1,
                    DatePlayed = datePlayed,
                }
            };

            _unitOfWorkMock.Setup(x => x.Matchdays.GetOrganizedMatchInformation(It.IsAny <int>()))
            .ReturnsAsync(latestMatches);

            // Act
            var result = await _sut.GetOrganizedMatchInformation(It.IsAny <int>());

            // Assert
            var firstMatch = result.FirstOrDefault();

            Assert.NotNull(firstMatch);
            Assert.Equal(datePlayed, firstMatch.DatePlayed);
            Assert.Equal(1, firstMatch.Id);
        }