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); }
public void GetCheckinReturnsHttpNotFoundWhenUnableToFindActivityByActivityId() { var sut = new ActivityApiController(Mock.Of<IMediator>()); var result = sut.GetCheckin(It.IsAny<int>()); Assert.IsType<HttpNotFoundResult>(result); }