示例#1
0
        public void ReadPlanetInfoFromXlsx_Should_Parse_Excel_File()
        {
            var expected = new[]
            {
                new PlanetInfo()
                {
                    Name = "Jupiter", MeanRadius = 69911.00
                },
                new PlanetInfo()
                {
                    Name = "Saturn", MeanRadius = 58232.00
                },
                new PlanetInfo()
                {
                    Name = "Uranus", MeanRadius = 25362.00
                },
                new PlanetInfo()
                {
                    Name = "Neptune", MeanRadius = 24622.00
                },
                new PlanetInfo()
                {
                    Name = "Earth", MeanRadius = 6371.00
                },
                new PlanetInfo()
                {
                    Name = "Venus", MeanRadius = 6051.80
                },
                new PlanetInfo()
                {
                    Name = "Mars", MeanRadius = 3390.00
                },
                new PlanetInfo()
                {
                    Name = "Mercury", MeanRadius = 2439.70
                },
            };

            var actual = StreamTask.ReadPlanetInfoFromXlsx(FileName).ToArray();

            Assert.IsTrue(expected.SequenceEqual(actual));

            CheckFileIsClosed(FileName);
        }