public void ValidateFile_WhenInvoked_ValidatesFile() { systemUnderTest.ValidateFile(filePayloadMock); Received.InOrder(() => { fileCompressionServiceMock .Received(1).DecompressFile("DownloadFilePath", "DecompressedDownloadFilePath"); fileReaderServiceMock.Received(1).ReadFile(filePayloadMock); statsFileParserServiceMock.Parse(filePayloadMock); }); }
public void Execute_WhenLegacyReaderRecordsForDayReadFires_CompressesStatsFiles() { var outputRecords = new List <StatsDataItem>(); outputRecords.Add(new StatsDataItem()); var inputRecords = SetUpLegacyDataReader(); dataMappingServiceMock.MapData(inputRecords).Returns(outputRecords); var outputFilename = SetUpStatsFileIntermediateOutputFilename(inputRecords); var tempCompressedFilename = @"c:\path\to\tmp\tmpfile.tmp"; fileSystemOperationsServiceMock.GetTempFilename().Returns(tempCompressedFilename); systemUnderTest.Execute(new[] { "arg1", "arg2" }); fileCompressionServiceMock.Received(1).CompressFile(outputFilename, tempCompressedFilename); }