public void GetPromotion_PromotionRequestedDoesntExist_NothingReturned()
        {
            var promotion = new Promotions()
            {
                Id = 1
            };
            var promotion2 = new Promotions()
            {
                Id = 2
            };

            _mockPromotions.SetSource(new[] { promotion, promotion2 });
            _mockPromotions.Setup(m => m.Include("DisplayTypes")).Returns(_mockPromotions.Object);

            var result = _repository.GetPromotion(3);

            result.Should().BeNull();
        }
Example #2
0
        public void GetPromotionById_OnValidId_ReturnPromotion()
        {
            // Arrange
            var id = PromotionsDb.promotions[0].Id;

            // Act
            var result = _promotionsRepository.GetPromotion(id);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(id, result.Id);
        }