コード例 #1
0
        public void ParseXMLtoFeedList_ReturnsExpectedList()
        {
            //Arrange
            string      pathToXML = Path.Combine(Environment.CurrentDirectory, @"data/rssFeedData.xml");
            XmlDocument xmlDoc    = new XmlDocument();

            xmlDoc.Load(pathToXML);
            var expectedType = typeof(Feed);

            //Act
            var list = rssFeedService.ParseXMLtoFeedList(xmlDoc.InnerXml);

            //Assert
            Assert.Equal(29, list.Count);
            Assert.IsType(expectedType, list[0]);
            Assert.NotEmpty(list);
            Assert.Equal("You need API management help: 11 open-source tools to consider", list[0].Title);
        }