|
namespace RegiRide.Tests
{
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RegiRide.Export;
using RegiRide.Model;
[TestClass]
public class RideExportManagerTest
{
[TestMethod]
public void GenerateExport_Should_Generate_Line_For_Every_Ride()
{
const int NumberOfLinesToGenerate = 10;
var mock = new RideLineExporterMock();
var exportManager = new ExportManager(mock, new ExportHeaderGenerator());
string exportFile = exportManager.GenerateExport(RideGeneratorMother.CreateRideList(NumberOfLinesToGenerate));
Assert.AreEqual(NumberOfLinesToGenerate, mock.NumberOfLinesGenerated);
}
internal class RideLineExporterMock : RideLineExporter
{
public RideLineExporterMock() : base(new RideTypeConverter())
{
}
public int NumberOfLinesGenerated { get; set; }
public override string GenerateLine(Ride rideToExport)
{
NumberOfLinesGenerated++;
return string.Empty;
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Patrick Kalkman is a senior Software Architect with more than 20 years professional development experience. He works for
SimpleTechture where he helps teams develop state of the art web applications.
Patrick enjoys writing his
blog. It discusses agile software development. Patrick can be reached at patrick@simpletechture.nl.
Published Windows 8 apps:
Published Windows Phone apps:
Awards:
Best Mobile article of March 2012
Best Mobile article of June 2012