public void TestGetFilePathShouldReturnFilePath() { var sourceDto = new CsvFileSourceDto() { FilePath = @"C:\Test.csv" }; _mockService.Setup(p => p.Execute(It.IsAny <GetCsvFileSourceQuery>())) .Returns(sourceDto); var result = _viewModel.FilePath; Assert.That(result, Is.EqualTo(@"C:\Test.csv")); }
public void SetUp() { _source = new CsvFileSource(); _sourceDto = new CsvFileSourceDto(); _mockAdapter = new Mock <ICsvFileSourceAdapter>(); _mockAdapter.Setup(p => p.Adapt(_source)).Returns(_sourceDto); _mockRepository = new Mock <ISourceRepository>(); _mockRepository.Setup(p => p.GetSource <CsvFileSource>()).Returns(_source); _handler = new GetCsvFileSourceQueryHandler( _mockRepository.Object, _mockAdapter.Object); }