예제 #1
0
        public void GetFrom_ShouldReturnSuccessfulResultReturnedByProvidedReader(string fileName, string fileExtension)
        {
            var path = $"{fileName}.{fileExtension}";
            var data = new[]
            {
                new Dictionary <string, double> {
                    { "one", 1.1 }, { "two", 2.1 }
                },
                new Dictionary <string, double> {
                    { "one", 1.2 }, { "two", 2.2 }
                }
            };
            var expectedResult = DataResult.CreateSuccessful(data);

            _fakeReaderProvider.GetByExtension(fileExtension).Returns(_fakeReader);
            _fakeReader.Read(path).Returns(expectedResult);

            var result = _provider.GetFrom(path);

            result.ShouldBeEquivalentTo(expectedResult);
        }