Пример #1
0
        public void GetById_ReturnsNullIfTrendDoesNotExist()
        {
            //Arrange
            Trend trend = new Trend
            {
                Id = Guid.Parse("3fa85f64-5717-4562-b3fc-2c963f66afa6")
            };

            trendRepositoryMock.Setup(x => x.GetById(Guid.Parse("3fa85f64-5717-4562-b3fc-2c963f66afa6"))).Returns(() => null);

            //Act
            TrendGetByIdDto trendGetByIdDto = systemUnderTest.GetById(trend.Id);

            //Assert
            Assert.Null(trendGetByIdDto);
        }
Пример #2
0
        public void GetById_ReturnsTrendById()
        {
            //Arrange
            Trend trend = new Trend
            {
                Id = Guid.Parse("3fa85f64-5717-4562-b3fc-2c963f66afa6")
            };

            trendRepositoryMock.Setup(x => x.GetById(Guid.Parse("3fa85f64-5717-4562-b3fc-2c963f66afa6"))).Returns(trend);

            //Act
            TrendGetByIdDto trendGetByIdDto = systemUnderTest.GetById(trend.Id);

            //Assert
            Assert.True(trend.Id.Equals(trendGetByIdDto.Id));
        }