public void GetTradeDates_WhenNoTradeDatesExist_ReturnsFailureResultWithApplicationError()
        {
            // Arrange
            Mock <ITradeDateRepository> tradeDateRepository = new Mock <ITradeDateRepository>();
            List <TradeDate>            tradeDates          = new List <TradeDate>();

            tradeDateRepository.Setup(r => r.GetTradeDates())
            .Returns(tradeDates);

            // Act
            TradeDateService service = new TradeDateService(tradeDateRepository.Object);
            var result = service.GetTradeDates();

            // Assert
            result.IsSuccess.Should().BeFalse();
            result.Value.Should().BeNull();
            result.Error.Should().BeOfType <ApplicationError>();
        }
        public void GetTradeDates_WhenTradeDatesExist_ReturnsListOfTradeDatesInSuccessfulResult()
        {
            // Arrange
            Mock <ITradeDateRepository> tradeDateRepository = new Mock <ITradeDateRepository>();
            List <TradeDate>            tradeDates          = new List <TradeDate>()
            {
                new TradeDate(new DateTime(2018, 12, 27), false, false, false),
                new TradeDate(new DateTime(2018, 12, 28), false, false, false),
                new TradeDate(new DateTime(2018, 12, 31), true, true, true)
            };

            tradeDateRepository.Setup(r => r.GetTradeDates())
            .Returns(tradeDates);

            // Act
            TradeDateService service = new TradeDateService(tradeDateRepository.Object);
            var result = service.GetTradeDates();

            // Assert
            result.IsSuccess.Should().BeTrue();
            result.Value.Count.Should().Be(tradeDates.Count);
        }