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); }
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); }