示例#1
0
        public async Task ReadFileAsLinesAsync_Null_ReturnsNull()
        {
            // arrange
            var service = new Services.FileReader();

            // act
            var actual = await service.ReadFileAsLinesAsync(null);

            // assert
            Assert.IsNull(actual);
        }
示例#2
0
        public async Task ReadFileAsLinesAsync_CorrectFilePath_ReturnsTextLineCollection(string path)
        {
            // arrange
            var inputLines = (await FileReadeHelper.ReadFromFileAsync(path)).Split(Environment.NewLine).ToList();
            var service    = new Services.FileReader();

            // act
            var actual = await service.ReadFileAsLinesAsync(path);

            // assert
            Assert.IsNotNull(actual);
            Assert.IsInstanceOfType(actual, typeof(List <string>));
            Assert.AreEqual(inputLines.Count, actual.Count);
        }