public void TestThat_VotesPerHour_UsesTheDataObtainedFromTheDataProvider_ToCreateTheChartData() { var votes = new[] {new DateTimeVoteModel()}; var dataProvider = new DataProviderBuilder().WithVotesPerHour(votes).Build(); var chartDataConverter = new ChartDataConverterBuilder().Build(); var controller = new VotingControllerBuilder() .WithDataProvider(dataProvider) .WithChartDataConverter(chartDataConverter) .Build(); controller.VotesPerHour(); chartDataConverter.Received().ToChartData(votes, Arg.Any<Func<DateTimeVoteModel, long>>()); }
public void TestThat_VotesPerHour_PassesTheCorrectChartDataToTheView() { long[][] chartData = new long[2][]; var chartDataConverter = new ChartDataConverterBuilder().WithChartDataPerHour(chartData).Build(); var controller = new VotingControllerBuilder().WithChartDataConverter(chartDataConverter).Build(); var model = controller.VotesPerHour().GetViewModel<long[][]>(); CollectionAssert.AreEquivalent(chartData, model); }