コード例 #1
0
        public void GetCheckinReturnsTheCorrectView()
        {
            var mediator = new Mock<IMediator>();
            mediator.Setup(x => x.Send(It.IsAny<ActivityByActivityIdQuery>())).Returns(new Activity { Campaign = new Campaign { ManagingOrganization = new Organization() }});

            var sut = new ActivityApiController(mediator.Object);
            var result = (ViewResult)sut.GetCheckin(It.IsAny<int>());

            Assert.Equal("NoUserCheckin", result.ViewName);
        }
コード例 #2
0
 public void GetCheckinReturnsHttpNotFoundWhenUnableToFindActivityByActivityId()
 {
     var sut = new ActivityApiController(Mock.Of<IMediator>());
     var result = sut.GetCheckin(It.IsAny<int>());
     Assert.IsType<HttpNotFoundResult>(result);
 }