public void Render_WhenEmptyHorseList_DoesNotFail() { var mockWriter = new Mock <IWriter>(); mockWriter.Setup(x => x.WriteLine(It.IsAny <string>())); var renderer = new HorsesByPriceRenderer(mockWriter.Object); renderer.Render(new List <Horse>()); }
public void Render_WhenInvalidHorseList_ThrowsException() { var mockWriter = new Mock <IWriter>(); mockWriter.Setup(x => x.WriteLine(It.IsAny <string>())); var renderer = new HorsesByPriceRenderer(mockWriter.Object); var ex = Assert.Throws <ApplicationException>(() => renderer.Render(null)); Assert.Equal("Horses array provided to render is invalid", ex.Message); }
public void Setup() { _writer = A.Fake <Utils.IOutputWriter>(); _subject = new HorsesByPriceRenderer(_writer); }