public void GetListOfMatchsFromEitherStoreOrAPIFromStoreTest()
        {
            mockStoreData.Setup(x => x.CheckStoreAlreadyExists(It.IsAny <int>())).Returns(true);
            mockReadWrite.Setup(x => x.ReadFromStore(It.IsAny <int>())).Returns(new List <Objects.Match>()
            {
                new Objects.Match {
                    MatchTeamId = 12345, IsAtHome = true, OpponentTeamId = 98765, TeamLogoFileName = "12345.png"
                },
                new Objects.Match {
                    MatchTeamId = 12345, IsAtHome = true, OpponentTeamId = 98765, TeamLogoFileName = "12345.png"
                },
                new Objects.Match {
                    MatchTeamId = 12345, IsAtHome = true, OpponentTeamId = 98765, TeamLogoFileName = "12345.png"
                },
                new Objects.Match {
                    MatchTeamId = 12345, IsAtHome = true, OpponentTeamId = 98765, TeamLogoFileName = "12345.png"
                },
                new Objects.Match {
                    MatchTeamId = 54321, IsAtHome = true, OpponentTeamId = 98765, TeamLogoFileName = "54321.png"
                },
            });

            var result = service.GetListOfMatchsFromEitherStoreOrAPI(2019, 12345);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Any());
            Assert.AreEqual(4, result.Count);
        }
Esempio n. 2
0
        public IEnumerable <Match> GetAllMatchesForTeam(int startYear, int endYear, int teamId)
        {
            var v1 = service.GetListOfMatchsFromEitherStoreOrAPI(startYear, endYear, teamId);

            return(v1);
        }