コード例 #1
0
        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>());
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public void Setup()
 {
     _writer  = A.Fake <Utils.IOutputWriter>();
     _subject = new HorsesByPriceRenderer(_writer);
 }