public void GetValueBothDates()
        {
            var mockRepository = new MockRepository(MockBehavior.Strict);

            var stockId  = Guid.NewGuid();
            var response = new PortfolioValueResponse();

            var service = mockRepository.Create <IPortfolioValueService>();

            service.Setup(x => x.GetValue(stockId, new DateRange(new Date(2000, 01, 01), new Date(2000, 12, 31)), It.IsAny <ValueFrequency>())).Returns(ServiceResult <PortfolioValueResponse> .Ok(response)).Verifiable();

            var controller = new HoldingController();
            var result     = controller.GetValue(service.Object, stockId, new DateTime(2000, 01, 01), new DateTime(2000, 12, 31), null);

            result.Result.Should().BeOkObjectResult().Value.Should().Be(response);

            mockRepository.VerifyAll();
        }
        public void GetValueMonthly()
        {
            var mockRepository = new MockRepository(MockBehavior.Strict);

            var stockId  = Guid.NewGuid();
            var response = new PortfolioValueResponse();

            var service = mockRepository.Create <IPortfolioValueService>();

            service.Setup(x => x.GetValue(stockId, It.IsAny <DateRange>(), ValueFrequency.Month)).Returns(ServiceResult <PortfolioValueResponse> .Ok(response)).Verifiable();

            var controller = new HoldingController();
            var result     = controller.GetValue(service.Object, stockId, null, null, ValueFrequency.Month);

            result.Result.Should().BeOkObjectResult().Value.Should().Be(response);

            mockRepository.VerifyAll();
        }
        public void GetValueNotFound()
        {
            var mockRepository = new MockRepository(MockBehavior.Strict);

            var stockId  = Guid.NewGuid();
            var response = new PortfolioValueResponse();

            var service = mockRepository.Create <IPortfolioValueService>();

            service.Setup(x => x.GetValue(stockId, new DateRange(Date.Today.AddYears(-1).AddDays(1), Date.Today), It.IsAny <ValueFrequency>())).Returns(ServiceResult <PortfolioValueResponse> .Ok(response)).Verifiable();

            var controller = new HoldingController();
            var result     = controller.GetValue(service.Object, stockId, null, null, null);

            result.Result.Should().BeOkObjectResult().Value.Should().Be(response);

            mockRepository.VerifyAll();
        }