public void GetData_WhenFileIsNull_ReturnNull() { // Arrange var stubFileAccessProvider = MockRepository.GenerateStub<IFileAccessProvider>(); stubFileAccessProvider.Stub(x => x.ReadFileContents("")).IgnoreArguments().Return(null); // Act var sut = new UnsettledRepository(stubFileAccessProvider); var result = sut.GetData(""); // Assert Assert.IsNull(result); }
public void GetData_WhenUnsettledDataIsRequested_ReturnList() { // Arrange var stubData = new[] { "1,11,4,50,500" , "3,11,6,50,0" , "4,11,7,300,1200" , "5,11,2,20,80" , "1,12,4,500,0" }; var stubFileAccessProvider = MockRepository.GenerateStub<IFileAccessProvider>(); stubFileAccessProvider.Stub(x => x.ReadFileContents("")).IgnoreArguments().Return(stubData); // Act var sut = new UnsettledRepository(stubFileAccessProvider); var result = sut.GetData(""); // Assert Assert.AreEqual(5, result.Count()); }