public void IndexRendersWhenIssueExists()
        {
            var issue = new TychaiaTuesdayIssueModel
            {
                Title   = "Test Title",
                Content = "Test Content"
            };

            Assert.DoesNotThrow(() =>
                                RazorHelper <TychaiaTuesdayViewModel> .GenerateAndExecuteTemplate(
                                    this.GetIndexView(),
                                    new TychaiaTuesdayViewModel {
                Issue = issue, IssueNo = 1
            }));
        }
        public void IndexDisplaysIssueWhenIssueExists()
        {
            var issue = new TychaiaTuesdayIssueModel
            {
                Title   = "Test Title",
                Content = "Test Content"
            };

            var html = RazorHelper <TychaiaTuesdayViewModel> .GenerateAndExecuteTemplate(
                this.GetIndexView(),
                new TychaiaTuesdayViewModel { Issue = issue, IssueNo = 1 });

            Assert.Contains("Issue #1", html.Text);
            Assert.Contains(issue.Title, html.Text);
            Assert.Contains(issue.Content, html.Text);
        }
        public void IssueIsPassedThroughFromPhabricator()
        {
            var issue = new TychaiaTuesdayIssueModel
            {
                Title   = "Test Title",
                Content = "Test Content"
            };
            var kernel = new MoqMockingKernel();

            IoC.ReplaceKernel(kernel);
            kernel.Unbind <IPhabricator>();
            var mock = kernel.GetMock <IPhabricator>();

            mock.Setup(m => m.GetTychaiaTuesdayIssue(It.IsAny <ConduitClient>(), 1)).Returns(issue);
            var controller = kernel.Get <TuesdayController>();
            var result     = controller.Index(1);

            Assert.IsType <ViewResult>(result);
            var viewResult = result as ViewResult;

            Assert.IsType <TychaiaTuesdayViewModel>(viewResult.Model);
            Assert.Equal(issue, ((TychaiaTuesdayViewModel)viewResult.Model).Issue);
            Assert.Equal(1, ((TychaiaTuesdayViewModel)viewResult.Model).IssueNo);
        }