Ejemplo n.º 1
0
        public void EmailSent_ShouldReturn_ViewResultIfSentEmailNotEmpty()
        {
            _tempData["SentEmail"].Returns("*****@*****.**");

            var result = _controller.EmailSent();

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

            Assert.Equal("EmailSent", viewResult.ViewName);

            var viewModel = Assert.IsType <SaveProgressViewModel>(viewResult.Model);

            Assert.Equal("*****@*****.**", viewModel.SentTo);
        }
        public void EmailSent_ShouldReturn_ViewResultIfSentEmailNotEmpty()
        {
            _session.TryGetValue("session-id", out Arg.Any <byte[]>())
            .Returns(x => {
                x[1] = Encoding.UTF8.GetBytes("201904-Abc123");
                return(true);
            });

            _tempData["SentEmail"].Returns("*****@*****.**");

            var result = _controller.EmailSent();

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

            Assert.Equal("EmailSent", viewResult.ViewName);

            var viewModel = Assert.IsType <SaveProgressViewModel>(viewResult.Model);

            Assert.Equal("*****@*****.**", viewModel.SentTo);
        }