public void IsSatisfiedBy_WhenNotSatisfied_ShouldReturnFalse(Price price)
        {
            // Arrange
            var request = new GetAveragePriceQuery
            {
                Portfolio  = string.Empty,
                Owner      = string.Empty,
                Instrument = string.Empty
            };

            // Act
            var actual = this.sut.IsSatisfiedBy(price, request);

            // Assert
            actual.Should().BeFalse();
        }
        public async Task GetAveragePrice_WhenCalled_ShouldSendQuery(
            GetAveragePriceDto dto,
            GetAveragePriceQuery query)
        {
            // Arrange
            this.mapperMock
            .Setup(m => m.Map <GetAveragePriceQuery>(dto))
            .Returns(query);

            this.mediatorMock
            .Setup(m => m.Send(query, default))
            .ReturnsAsync(It.IsAny <IHandlerResult <AveragePriceViewModel> >());

            // Act
            await this.sut.GetAverage(dto);

            // Assert
            this.mediatorMock.VerifyAll();
        }
        public void IsSatisfiedBy_WhenSatisfied_ShouldReturnTrue(Price price)
        {
            // Arrange
            this.dateTimeConverterMock
            .Setup(x => x.DateTimeToTimeSlot(It.IsAny <DateTime>()))
            .Returns(price.Timeslot);

            var request = new GetAveragePriceQuery
            {
                Portfolio  = price.Portfolio.Name,
                Owner      = price.Owner.Name,
                Instrument = price.Instrument.Name
            };

            // Act
            var actual = this.sut.IsSatisfiedBy(price, request);

            // Assert
            actual.Should().BeTrue();
        }