public void Index_TestDefaultTemplateViewName()
        {
            using (var controller = new DummyAccountActivationController())
            {
                var result = (ViewResult)controller.Index();

                Assert.AreEqual("AccountActivation.AccountActivation", result.ViewName);
            }
        }
        public void Index_TestDefaultTemplateViewName()
        {
            using (var controller = new DummyAccountActivationController())
            {
                var result = (ViewResult)controller.Index();

                Assert.AreEqual("AccountActivation.AccountActivation", result.ViewName);
            }
        }
        public void Index_TestDefaultValuesOfViewModel()
        {
            using (var controller = new DummyAccountActivationController())
            {
                controller.TemplateName = "MyTestTemplate";

                var stubModel = controller.Model as DummyAccountActivationModel;
                stubModel.QueryString = new NameValueCollection();

                var result = (ViewResult)controller.Index();

                var model = result.Model as AccountActivationViewModel;

                Assert.IsNotNull(model);
                Assert.IsNull(model.CssClass);
                Assert.IsNotNull(model.ProfilePageUrl);
                Assert.IsFalse(model.Activated);
            }
        }
        public void Index_TestDefaultValuesOfViewModel()
        {
            using (var controller = new DummyAccountActivationController())
            {
                controller.TemplateName = "MyTestTemplate";

                var stubModel = controller.Model as DummyAccountActivationModel;
                stubModel.QueryString = new NameValueCollection();

                var result = (ViewResult)controller.Index();

                var model = result.Model as AccountActivationViewModel;

                Assert.IsNotNull(model);
                Assert.IsNull(model.CssClass);
                Assert.IsNotNull(model.ProfilePageUrl);
                Assert.IsFalse(model.Activated);
            }
        }
        public void Index_TestDefaultValuesWithActualUser()
        {
            using (var controller = new DummyAccountActivationController())
            {
                var stubModel = controller.Model as DummyAccountActivationModel;
                stubModel.QueryString = new NameValueCollection();
                stubModel.QueryString.Add("user", "DB798044-0F65-42B0-9AF6-126BA2AF6FA9");
                stubModel.QueryString.Add("provider", "Provider name");

                var viewResult = controller.Index() as ViewResult;

                Assert.IsNotNull(viewResult);

                var viewModel = viewResult.Model as AccountActivationViewModel;

                Assert.IsNotNull(viewModel);
                Assert.IsTrue(viewModel.Activated);
                Assert.AreEqual(viewModel.ProfilePageUrl, DummyAccountActivationModel.PageUrl);
            }
        }
        public void Index_TestDefaultValuesWithActualUser()
        {
            using (var controller = new DummyAccountActivationController())
            {
                var stubModel = controller.Model as DummyAccountActivationModel;
                stubModel.QueryString = new NameValueCollection();
                stubModel.QueryString.Add("user", "DB798044-0F65-42B0-9AF6-126BA2AF6FA9");
                stubModel.QueryString.Add("provider", "Provider name");

                var viewResult = controller.Index() as ViewResult;

                Assert.IsNotNull(viewResult);

                var viewModel = viewResult.Model as AccountActivationViewModel;

                Assert.IsNotNull(viewModel);
                Assert.IsTrue(viewModel.Activated);
                Assert.AreEqual(viewModel.ProfilePageUrl, DummyAccountActivationModel.PageUrl);
            }
        }