Ejemplo n.º 1
0
        public async Task ReturnCorrectData()
        {
            var result = await _sut.Handle(_message);

            result.ShouldNotBeNull();
            result.Id.ShouldBe(CampaignId);
        }
        public void HandleCallsGetCampaignWithCorrectCampaignId()
        {
            var message = new CampaignByCampaignIdQuery { CampaignId = 1 };
            var mockedDataAccess = new Mock<IAllReadyDataAccess>();

            var sut = new CampaignByCampaignIdQueryHandler(mockedDataAccess.Object);
            sut.Handle(message);

            mockedDataAccess.Verify(x => x.GetCampaign(message.CampaignId));
        }
        public void HandleCallsGetCampaignWithCorrectCampaignId()
        {
            var message = new CampaignByCampaignIdQuery {
                CampaignId = 1
            };
            var mockedDataAccess = new Mock <IAllReadyDataAccess>();

            var sut = new CampaignByCampaignIdQueryHandler(mockedDataAccess.Object);

            sut.Handle(message);

            mockedDataAccess.Verify(x => x.GetCampaign(message.CampaignId));
        }
        public void HandleReturnsCorrectCampaign()
        {
            var message = new CampaignByCampaignIdQuery { CampaignId = 1 };
            var campaign = new Campaign { Id = message.CampaignId };

            var mockedDataAccess = new Mock<IAllReadyDataAccess>();
            mockedDataAccess.Setup(m => m.GetCampaign(message.CampaignId)).Returns(campaign);

            var sut = new CampaignByCampaignIdQueryHandler(mockedDataAccess.Object);
            var result = sut.Handle(message);

            Assert.Same(campaign, result);
        }
        public void HandleReturnsCorrectCampaign()
        {
            var message = new CampaignByCampaignIdQuery {
                CampaignId = 1
            };
            var campaign = new Campaign {
                Id = message.CampaignId
            };

            var mockedDataAccess = new Mock <IAllReadyDataAccess>();

            mockedDataAccess.Setup(m => m.GetCampaign(message.CampaignId)).Returns(campaign);

            var sut    = new CampaignByCampaignIdQueryHandler(mockedDataAccess.Object);
            var result = sut.Handle(message);

            Assert.Same(campaign, result);
        }
Ejemplo n.º 6
0
        public async Task ReturnCorrectData()
        {
            var result = await sut.Handle(message);

            Assert.Same(campaign, result);
        }