<commit_before>﻿using CGO.Web.Controllers;
using CGO.Web.Infrastructure;

using NSubstitute;

using NUnit.Framework;

using MvcContrib.TestHelper;

namespace CGO.Web.Tests.Controllers
{
    class UserControllerFacts
    {
        [TestFixture]
        public class LoginShould
        {
            [Test]
            public void DisplayTheLoginView()
            {
                var controller = new UserController(Substitute.For<IFormsAuthenticationService>());

                var result = controller.Login();

                result.AssertViewRendered().ForView("Login");
            }
        }

        [TestFixture]
        public class LogoutShould
        {
            [Test]
            public void ClearTheAuthenticationCookie()
            {
                var formsAuthentication = Substitute.For<IFormsAuthenticationService>();
                var controller = new UserController(formsAuthentication);

                controller.Logout();
<commit_msg>Throw ArgumentNullException.<commit_after>﻿using System;

using CGO.Web.Controllers;
using CGO.Web.Infrastructure;

using NSubstitute;

using NUnit.Framework;

using MvcContrib.TestHelper;

namespace CGO.Web.Tests.Controllers
{
    class UserControllerFacts
    {
        [TestFixture]
        public class ConstructorShould
        {
            [Test]
            public void ThrowAnArgumentNullExceptionWhenTheFormsAuthenticationServiceIsNull()
            {
                Assert.That(() => new UserController(null), Throws.InstanceOf<ArgumentNullException>());
            }
        }

        [TestFixture]
        public class LoginShould
        {
            [Test]
            public void DisplayTheLoginView()
            {
                var controller = new UserController(Substitute.For<IFormsAuthenticationService>());

                var result = controller.Login();

                result.AssertViewRendered().ForView("Login");
            }
        }

        [TestFixture]
        public class LogoutShould
        {
            [Test]
            public void ClearTheAuthenticationCookie()
            {
                var formsAuthentication = Substitute.For<IFormsAuthenticationService>();
                var controller = new UserController(formsAuthentication);

                controller.Logout();

{'fraction_non_alphanumeric': 0.0782608695652174, 'fraction_numerical': 0.0, 'mean_word_length': 1.9805699481865284, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3829018', 'n_tokens_mistral': 568, 'n_tokens_neox': 544, 'n_words': 107}