public void GetTrendlineById_ReturnsNull_IfThereIsNoTrendlineWithSuchId() { //Arrange EFTrendlineRepository repository = new EFTrendlineRepository(); List <TrendlineDto> trendlines = new List <TrendlineDto>(); trendlines.AddRange(new TrendlineDto[] { getDefaultTrendlineDto() }); clearTrendlinesTables(); repository.UpdateTrendlines(trendlines); //Act TrendlineDto resultDto = repository.GetTrendlineById(2); //Assert Assert.IsNull(resultDto); }
public void GetTrendlineById_ReturnsProperTrendlineDto_IfExists() { //Arrange EFTrendlineRepository repository = new EFTrendlineRepository(); List <TrendlineDto> trendlines = new List <TrendlineDto>(); TrendlineDto expectedDto = getDefaultTrendlineDto(); trendlines.AddRange(new TrendlineDto[] { expectedDto }); clearTrendlinesTables(); repository.UpdateTrendlines(trendlines); //Act TrendlineDto dto = repository.GetTrendlineById(expectedDto.Id); //Assert var areEqual = expectedDto.Equals(dto); Assert.IsTrue(areEqual); }