Пример #1
0
        public void GetTrendBreakById_ReturnsNull_IfThereIsNoTrendlineWithSuchId()
        {
            //Arrange
            EFTrendlineRepository repository  = new EFTrendlineRepository();
            List <TrendBreakDto>  trendBreaks = new List <TrendBreakDto>();

            trendBreaks.AddRange(new TrendBreakDto[] { getDefaultTrendBreakDto() });
            clearTrendBreaksTables();
            repository.UpdateTrendBreaks(trendBreaks);

            //Act
            TrendBreakDto resultDto = repository.GetTrendBreakById(50);

            //Assert
            Assert.IsNull(resultDto);
        }
Пример #2
0
        public void GetTrendBreakById_ReturnsProperTrendlineDto_IfExists()
        {
            //Arrange
            EFTrendlineRepository repository  = new EFTrendlineRepository();
            List <TrendBreakDto>  trendBreaks = new List <TrendBreakDto>();
            TrendBreakDto         expectedDto = getDefaultTrendBreakDto();

            trendBreaks.AddRange(new TrendBreakDto[] { expectedDto });
            clearTrendBreaksTables();
            repository.UpdateTrendBreaks(trendBreaks);

            //Act
            TrendBreakDto resultDto = repository.GetTrendBreakById(expectedDto.Id);

            //Assert
            var areEqual = expectedDto.Equals(resultDto);

            Assert.IsTrue(areEqual);
        }