コード例 #1
0
        public void Init()
        {
            _transformer        = new Mock <ITransformer>();
            _transformerFactory = new Mock <ITransformerFactory>();

            _transformer.Setup(x => x.Transform(It.IsAny <StreamReader>())).Returns(EnglishPremierLeagueObjectMother.GetEnglishPremierLeagueTeams());
            _transformerFactory.Setup(x => x.FetchTransformer(It.IsAny <FileExtensionType>())).Returns(_transformer.Object);

            _target = new EnglishPremierLeagueService(_transformerFactory.Object);
        }
コード例 #2
0
        public void EnglishPremierLeagueService_GetTeamWithLeastGoalDifference_Fetches_Right_Result_On_Multiple_Teams_With_Same_GoalDifference_On_DAT_Upload()
        {
            //Arrange
            _transformer.Setup(x => x.Transform(It.IsAny <StreamReader>())).
            Returns(EnglishPremierLeagueObjectMother.GetEnglishPremierLeagueTeamsWithSameGoalDifference());

            //Act
            var result = _target.GetTeamsWithLeastGoalDifference(It.IsAny <StreamReader>(), FileExtensionType.DAT);

            //Assert
            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(List <EnglishPremierLeagueTeam>));
            Assert.IsTrue((result as List <EnglishPremierLeagueTeam>).Count > 0);
        }