示例#1
0
        public void GetFootballClubList_WrongColumnCount()
        {
            var tester = new FootballClubArray();
            var ouput  = tester.GetFootballClubList(new CSVFileReading(FileCellError));

            Assert.AreEqual(20, ouput.Count);
            Assert.AreEqual(2, ouput.Where(i => i.ErrorFound).Count());
            Assert.AreEqual(true, tester.GetContainsError());
        }
示例#2
0
        public void GetFootballClubList_MissingHeader()
        {
            var tester = new FootballClubArray();
            var ouput  = tester.GetFootballClubList(new CSVFileReading(FileMissingHeader));

            Assert.AreEqual(20, ouput.Count);
            Assert.AreEqual(0, ouput.Where(i => i.ErrorFound).Count());
            Assert.AreEqual(false, tester.GetContainsError());
        }
示例#3
0
        public void GetFootballClubList_moq()
        {
            var list = new List <string[]>();

            list.Add(new string[] { "1. ClubName", "1", "2", "3", "4", "5", "-", "6", "7" });
            list.Add(new string[] { "1. ClubName", "11", "22", "33", "44", "55", "-", "66", "77" });
            var mock = new Mock <IFileReading>();

            mock.Setup(x => x.ReadFile()).Returns(list);
            var tester = new FootballClubArray();
            var ouput  = tester.GetFootballClubList(mock.Object);

            Assert.AreEqual(mock.Object.ReadFile().Count, 2);
            Assert.AreEqual(ouput.Count, 2);
            Assert.AreEqual(ouput.Where(i => i.ErrorFound).Count(), 0);
        }